Confusion about numbers

Tim Peters at
Fri Jan 10 01:54:53 CET 2003

[Terry Reedy]
> The unification will not be complete until 2.4 or 2.5.  Changes that
> break code will only be introduced after at least one release that
> emits warning.

[James J. Besemer]
> So THAT'S why 1<<32 == 0 in 2.2.2?

It depends on which platform you run that on.  If a C long is 32 bits, yes,
it returns 0.  If a C long is 64 bits, it returns 4294967296.  When
unification is complete, it will return 4294967296 on all platforms.  This
will break somebody's code, although not mine <wink>.

More information about the Python-list mailing list