Message413948
Oh wait, I'm now confused by the method names. In Python 3.10, the correct names at:
* float.__getformat__() <= 4 underscores
* float.__set_format__() <= 5 underscores
It's even more confusing because the "set format" is only used in one place: test_float, and test_float uses... __setformat__() (4 underscores).
A typo a was introduced in Python 3.7 by:
commit b5c51d3dd95bbfde533655fb86ac0f96f771ba7b
Author: Serhiy Storchaka <storchaka@gmail.com>
Date: Sat Mar 11 09:21:05 2017 +0200
bpo-20185: Convert float object implementation to Argument Clinic. (#543)
Based on patch by Vajrasky Kok.
Since Python 3.7, the 4 "set format" tests are simply skipped!
$ ./python -m test -v test_float
(...)
test_getformat (test.test_float.FormatFunctionsTestCase) ... skipped 'requires __setformat__'
test_setformat (test.test_float.FormatFunctionsTestCase) ... skipped 'requires __setformat__'
(...)
test_double_specials_dont_unpack (test.test_float.UnknownFormatTestCase) ... skipped 'requires __setformat__'
test_float_specials_dont_unpack (test.test_float.UnknownFormatTestCase) ... skipped 'requires __setformat__'
(...)
Moreover, unittest.mock supports mocking __setformat__() (4 underscores). |
|
Date |
User |
Action |
Args |
2022-02-25 00:54:40 | vstinner | set | recipients:
+ vstinner, tim.peters, rhettinger, mark.dickinson |
2022-02-25 00:54:40 | vstinner | set | messageid: <1645750480.8.0.44647546371.issue46852@roundup.psfhosted.org> |
2022-02-25 00:54:40 | vstinner | link | issue46852 messages |
2022-02-25 00:54:40 | vstinner | create | |
|