Skip to content

bpo-46852: Remove the float.__set_format__() method#31585

Merged
vstinner merged 1 commit intopython:mainfrom
vstinner:remove_float_setformat
Feb 25, 2022
Merged

bpo-46852: Remove the float.__set_format__() method#31585
vstinner merged 1 commit intopython:mainfrom
vstinner:remove_float_setformat

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented Feb 25, 2022

Remove the undocumented private float.set_format() method,
previously known as float.set_format() in Python 3.7. Its
docstring said: "You probably don't want to use this function. It
exists mainly to be used in Python's test suite."

https://bugs.python.org/issue46852

Remove the undocumented private float.__set_format__() method,
previously known as float.__set_format__() in Python 3.7. Its
docstring said: "You probably don't want to use this function. It
exists mainly to be used in Python's test suite."
@vstinner
Copy link
Copy Markdown
Member Author

@mdickinson: Would you mind to review this change?

@vstinner vstinner merged commit 5ab745f into python:main Feb 25, 2022
@vstinner vstinner deleted the remove_float_setformat branch February 25, 2022 23:53
@mdickinson
Copy link
Copy Markdown
Member

@mdickinson: Would you mind to review this change?

Happy to do so, if you'll allow me time. :-) But it appears I'm too late.

float.__setformat__('double', self.save_formats['double'])
float.__setformat__('float', self.save_formats['float'])

def test_getformat(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these tests still relevant?

Copy link
Copy Markdown
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I think test_getformat should be kept.

asvetlov pushed a commit that referenced this pull request Feb 26, 2022
Remove the undocumented private float.__set_format__() method,
previously known as float.__set_format__() in Python 3.7. Its
docstring said: "You probably don't want to use this function. It
exists mainly to be used in Python's test suite."
@vstinner
Copy link
Copy Markdown
Member Author

Happy to do so, if you'll allow me time. :-) But it appears I'm too late.

Sorry, sometimes I can be too impatient. I took your comment on the issue as an approval of the overall removal.

Aren't these tests still relevant?

... But I didn't review carefully removed tests! I saw requires_getformat and so I expected this decorator to be used on tests on __getformat__(). Nope. Not only all these were were skipped since Python 3.7 (now fixed in 3.9 and 3.10), but the requires_getformat variable was simply unused!

I wrote #31601 to add getformat tests removed by mistake.

Thanks for the review. Sorry again for not waiting for your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants