[New-bugs-announce] [issue5080] PyArg_Parse* should raise TypeError for float parsed with integer format
Mark Dickinson
report at bugs.python.org
Tue Jan 27 13:23:57 CET 2009
New submission from Mark Dickinson <dickinsm at gmail.com>:
Since Python 2.3, PyArg_ParseTuple and friends give a DeprecationWarning
for floating-point arguments where integers are expected. From
http://www.python.org/download/releases/2.3/NEWS.txt:
- 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.
----------
messages: 80649
nosy: marketdickinson
severity: normal
status: open
title: PyArg_Parse* should raise TypeError for float parsed with integer format
type: behavior
versions: Python 2.7
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5080>
_______________________________________
More information about the New-bugs-announce
mailing list