[issue21111] PyLong_AsUnsignedLongAndOverflow does not exist

Hristo Venev report at bugs.python.org
Sun Apr 6 17:16:57 CEST 2014


Hristo Venev added the comment:

I did not intend to make it so that PyLong_AsUnsignedLong* to call __int__ but it looks like a good idea because PyLong_AsLong* does that and the patch is exactly about that - removing differences between converting to signed and unsigned.

Should I upload the patch with docs and with the warning fixed? Will it be applied in 3.4.1? It will be a lot easier to check the value of an int than to create a new PyLong = 2^64 and compare the number with that.

P.S.: is there a very fast way to check if a PyLong fits in unsigned long long with the limited API?
P.P.S.: Just a random idea: would it be a to rewrite PyLong to use GMP instead as a PyVarObject of mp_limb_t's?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21111>
_______________________________________


More information about the Python-bugs-list mailing list