-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-85989: deprecate float.__getformat__() class method #146400
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
534939e
aaf2b0a
907bfb1
a8cbdbf
e38e308
3a4c818
b93f48c
04356f7
68a3264
9fe8a22
27d31f2
291401b
67fc46e
e4d5f18
3a0136e
ec18531
6dec973
d330317
40f9873
a7f9a1a
1389d58
2c55ab2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -486,8 +486,7 @@ def test_builtin__qualname__(self): | |
|
|
||
| # builtin classmethod: | ||
| self.assertEqual(dict.fromkeys.__qualname__, 'dict.fromkeys') | ||
| self.assertEqual(float.__getformat__.__qualname__, | ||
| 'float.__getformat__') | ||
| self.assertEqual(int.from_bytes.__qualname__, 'int.from_bytes') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the replacement also be a dunder method?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is nothing special for such case, except for a name. Commentary says those should be class methods. I would guess not so many were available in v3.2, when the test was added (5b62942). |
||
|
|
||
| # builtin staticmethod: | ||
| self.assertEqual(str.maketrans.__qualname__, 'str.maketrans') | ||
|
|
@@ -509,7 +508,7 @@ def test_builtin__self__(self): | |
|
|
||
| # builtin classmethod: | ||
| self.assertIs(dict.fromkeys.__self__, dict) | ||
| self.assertIs(float.__getformat__.__self__, float) | ||
|
skirpichev marked this conversation as resolved.
|
||
| self.assertIs(int.from_bytes.__self__, int) | ||
|
|
||
| # builtin staticmethod: | ||
| self.assertIsNone(str.maketrans.__self__) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| The ``__getformat__()`` class method of the :class:`float` is deprecated. On | ||
| CPython, ``float.__getformat__()`` always return a string, prefixed with | ||
| ``"IEEE"``: to build CPython, you need support for IEEE 754 floating-point | ||
| numbers since Python 3.11. Patch by Sergey B Kirpichev. |
Uh oh!
There was an error while loading. Please reload this page.