> On +2018-10-27 11:55:11 -0700, [email protected] wrote:
as I'm struggling with Windows at the moment, I may have an answer ... I find that for CPython3, sys.maxsize is (2**31)-1 on 32-bits Python and (2**63)-1 for 64-bits Python builds. With sys.maxint being a Python2 thing, it may be different there, but it seems 3 at least is perfectly consistent.Best regards, Wim -- [email protected] -- +1 (510) 486 6411 -- www.lavrijsen.net _______________________________________________ pypy-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-devDoes (2**63)-1 work because size is unsigned (presumably?) and (2**63) is then valid as an intermediate value before subtracting 1, whereas for a signed maxint, the intermediate value would have to be specialcased or the value written maybe like (2**62-1)+(2**62) ? Or does it involve a bigint representation somewhere? Regards, Bengt Richter
The sys.maxint vs sys.maxsize difference is the first thing that appears at http://doc.pypy.org/en/latest/windows.html#what-is-missing-for-a-full-64-bit-translation
There is a nice plan there to transition to a win64 python2 (which we need since rpython is written in python2) where sys.maxint == sys.maxsize == 2**63-1, and to continue from there to a pypy2 that can translate rpython.
Matti _______________________________________________ pypy-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-dev
