You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
title='PyArg_Parse* should raise TypeError for float parsed with integer format'updated_at=<Date2010-01-01.19:30:02.484>user='https://github.com/mdickinson'
The PyArg_Parse functions now issue a DeprecationWarning if a float
argument is provided when an integer is specified (this affects the 'b',
'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
raise a TypeError.
Can we turn that DeprecationWarning into a TypeError for 2.7? (It's
already a TypeError in 3.x.) I'd like to see things like 'range(-0.3)'
and 'itertools.combinations(range(3), 5.1)' raise TypeError.
N.B. The relevant format codes in 2.7 include 'I' and 'n' in addition to
the six codes listed above.
Hmm. That's unfortunate: for argument type in 'bBHiIlkKn', an attempt to
pass a float results in a DeprecationWarning. For type 'L', there's no
DeprecationWarning, and the float is silently truncated. So for type 'L'
I guess we still have to go through a round of DeprecationWarning.
I'm not sure what 'h' does; there don't appear to be any tests for it,