[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

STINNER Victor report at bugs.python.org
Tue Jul 2 01:56:43 CEST 2013


STINNER Victor added the comment:

Updated patch (version 3), addressing last issues of Mark's review:

- add a simple unit test in _testcapi: check that PyLong_AsIntMax_t(INTMAX_INT - 1), PyLong_AsIntMax_t(INTMAX_MAX + 1) and PyLong_AsUintMax_t(UINTMAX_MAX + 1) fail with OverflowError
- rely on stdint.h on Windows, with a fallback on __int64 for Visual Studio 2008
- PyLong_AsIntMax_t() and PyLong_AsUintMax_t() compute directly the result (rather than calling _PyLong_AsByteArray)

I give you one or two days for a last review, and then I'm going to commit the new functions.

----------
Added file: http://bugs.python.org/file30745/intmax_t-3.patch

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


More information about the Python-bugs-list mailing list