In Python 2.7, PyArg_ParseTuple and friends currently accept a float
argument where an integer is expected, but produce a
DeprecationWarning in this case.  This can be seen in various places
in Python proper:

>>> itertools.combinations(range(5), 2.0)
__main__:1: DeprecationWarning: integer argument expected, got float
<itertools.combinations object at 0x10059f638>

Are there any objections to turning this DeprecationWarning into a
TypeError for Python 2.7?  The behaviour has been deprecated since
Python 2.3, it's gone in 3.x, and having it produce an error in 2.7
might slightly reduce the number of surprises involved in porting from
2.x to 3.x.  There's a patch at http://bugs.python.org/issue5080

There's one fly in the ointment:  the deprecation warning is produced
for all integer codes except for one---the 'L' code.  The patch adds a
deprecation warning for this code.

Mark
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to