Int to long conversion bug?

Tim Peters tim.one at home.com
Sat Oct 13 22:27:49 EDT 2001


[Emile van Sebille]
> In view of the int to long automatic conversion, should this be
> considered a bug?
>
> F:\Python22>python
> Python 2.2a4 (#24, Sep 27 2001, 21:44:09) [MSC 32 bit (Intel)] on win32
>
> >>> n = int('9999999999')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ValueError: int() literal too large: 9999999999
> >>>
>
> I can use long() of course, but is it the intent that long become an
> implementation detail?

Eventually, but not yet for 2.2.  The details are in PEP 237, which is being
implemented in phases (read the PEP).  I expect int() could have gone either
way in the 2.2 phase, but as things turned out it's not changing yet.





More information about the Python-list mailing list