11-digit integer literal on a 32-bit CPU

Patrick Phalen pphalen at teleo.net
Tue Mar 7 06:31:49 CET 2000


[Tim Peters, on Mon, 06 Mar 2000]

:: >>> id = long("10000000000")
:: >>> id = id + 1
:: >>> str(id)
:: '10000000001L'
:: >>> str(id)[:-1]
:: '10000000001'
:: >>>
:: 
:: That is, converting strings to and from longs is easy.  You just have to
:: strip the trailing "L" on output.  Note that this is changing in 1.6, though
:: (i.e., the trailing "L" is going away via str(), but staying via repr()).
:: 
:: don't-let-one-character-drive-you-from-the-obvious-approach-ly y'rs  - tim


long() !!! Dagnabbit! I competely forgot about it.

Thank you. Although, I have to admit I'm tempted to keep Alex's
Transaction_ID class in place, just because it's so fiendishly
inventive. ;>)








More information about the Python-list mailing list