[issue7550] PyLong_As* methods should not call nb_int.
Mark Dickinson
report at bugs.python.org
Sun Dec 20 11:31:14 CET 2009
New submission from Mark Dickinson <dickinsm at gmail.com>:
The following C-API functions:
PyLong_AsLongAndOverflow
PyLong_AsUnsignedLongMask
PyLong_AsLongLong
PyLong_AsUnsignedLongLongMask
call nb_int for inputs that don't satisfy PyLong_Check. They thus accept
floats, Decimal instances, etc. They should probably call nb_index
instead (or perhaps accept only instances of int).
The uses of these functions within the Python source should be checked, to
see what consequences (if any) this change would have for Python
semantics; it's possible that some of these consequences would fall under
the moratorium (PEP 3003). In any case, this change probably requires a
1-release deprecation period.
----------
components: Interpreter Core
messages: 96670
nosy: mark.dickinson
severity: normal
status: open
title: PyLong_As* methods should not call nb_int.
versions: Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7550>
_______________________________________
More information about the Python-bugs-list
mailing list