• Thomas Wouters's avatar
    Make xrange more Py_ssize_t aware, by assuming a Py_ssize_t is always at · f4d8f390
    Thomas Wouters yazdı
    least as big as a long. I believe this to be a safe assumption that is being
    made in many parts of CPython, but a check could be added.
    
    len(xrange(sys.maxint)) works now, so fix the testsuite's odd exception for
    64-bit platforms too. It also fixes 'zip(xrange(sys.maxint), it)' as a
    portable-ish (if expensive) alternative to enumerate(it); since zip() now
    calls len(), this was breaking on (real) 64-bit platforms. No additional
    test was added for that behaviour.
    f4d8f390
test_xrange.py 2.07 KB