Can Python 1.5.2 code run on Python 2.x?

Erik Max Francis max at alcyone.com
Thu Mar 8 18:11:41 CET 2001


Laura Creighton wrote:

> Big change ... string conversion of long int no longer tacks an L on
> the end.  Since I just ripped off the last digit wholesale all over
> this code, I have many lines to change.

Use repr instead.

max at charmaine:~% python
Python 2.0 (#5, Nov 10 2000, 21:47:15) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> l = 299792458l      
>>> l
299792458L
>>> str(l)
'299792458'
>>> repr(l)
'299792458L'

This change in string conversions of longs was one of the documentation
changes, by the way.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Do you like what you see / Do you like yourself
\__/ Neneh Cherry
    Product's Quake III Arena Tips / http://www.bosskey.net/
 Tips and tricks from the absolute beginner to the Arena Master.



More information about the Python-list mailing list