print longs

Hrvoje Niksic hniksic at srce.hr
Tue Oct 5 10:46:10 EDT 1999


"Tim Peters" <tim_one at email.msn.com> writes:

> It can't ever be changed in Python1.  Too much existing e.g.
>     str(long)[:-1]
> and
>     hex(long)[2:-1]
> code would silently break.

A solution that might work in Python1 without breaking the world could
be to make "%ld" behave as one would expect.  For instance, "%ld" %
10000000000000000000L would evaluate to the printed representation of
the big number, but without the L.

This should not break existing programs because currently the same
expression raises an exception.




More information about the Python-list mailing list