Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2022
Merged

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

merged 1 commit into from
Feb 25, 2022

Conversation

vstinner
Copy link
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
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
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
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
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
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