[issue7550] PyLong_As* methods should not call nb_int.

2009-12-21 Thread Mark Dickinson
Mark Dickinson added the comment: It turns out this is intimately bound up with the behaviour of PyArg_ParseTuple* for integer format codes. Since this behaviour can't change until Python 3.3 (because of the moratorium), I'm closing this for now. -- resolution: -> later status: ope

[issue7550] PyLong_As* methods should not call nb_int.

2009-12-20 Thread Mark Dickinson
Mark Dickinson added the comment: Just as an experiment, I removed the calls to nb_int and ran the test- suite. The only test failures were in test_ctypes, test_getargs2, and test_math. The test_math failure was from math.factorial depending on PyLong_AsLong to convert floats; I've fixed th

[issue7550] PyLong_As* methods should not call nb_int.

2009-12-20 Thread Mark Dickinson
Mark Dickinson added the comment: Since PyLong_AsLong goes through PyLong_AsLongAndOverflow, this change would also affect calls to PyLong_AsLong. -- ___ Python tracker ___

[issue7550] PyLong_As* methods should not call nb_int.

2009-12-20 Thread Mark Dickinson
New submission from Mark Dickinson : 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