Message107352
Currently all but one of the integer format codes for getargs.c raise TypeError when passed a float. The 'L' code produces a warning rather than raising an error.
This was deliberate at the time, because all except the 'L' code already raised a DeprecationWarning in Python 3.1, and were converted to raise TypeError for 3.2. Since the 'L' code didn't raise a warning for float inputs in 3.1, directly raising a TypeError in 3.2 seemed a bit abrupt.
However, I'd like to revisit this decision, and make the 'L' code raise a TypeError in 3.2. Note that
(1) The 'L' code represents the Py_LONG_LONG type, and isn't used very much; I think the risk of unexpected breakage from this change is fairly small.
(2) One of the places that the 'L' code *is* used is when parsing strange C types (like off_t) that are matched with either size_t, long or long long at configure + build time. So one platform might end up parsing off_t types with the 'n' code, while another parses them with the 'L' code. It would be desirable for both platforms to have the same behaviour when passed a float.
Any objections to making this change?
See also issue 5080. |
|
Date |
User |
Action |
Args |
2010-06-08 21:42:48 | mark.dickinson | set | recipients:
+ mark.dickinson, vstinner |
2010-06-08 21:42:48 | mark.dickinson | set | messageid: <1276033368.49.0.876712618605.issue8950@psf.upfronthosting.co.za> |
2010-06-08 21:42:46 | mark.dickinson | link | issue8950 messages |
2010-06-08 21:42:45 | mark.dickinson | create | |
|