Why long integers

Joe Green someone at microsoft.com
Sun Oct 12 14:43:17 EDT 2003


I have been wondering why we have Long integers as a seperate type:

   import sys
   a=sys.maxint+1  # gives 2147483648L <- coerced to Long
   a=2147483648  # gives 2147483648L <- coerced to Long

so the first question is: what is the point of the L in a=2147483648L ?
and:

   a-=a #gives 0L

what is the advantage (or point of) it remaining Long ?

What I am tryinfg to say is, why is there not just an Integer type, which is
normally 2 bytes, but expands AND contracts as necessary ?
(Part of the explanation will be historical, but ignoring that)






More information about the Python-list mailing list