PEP0238 lament

Guido van Rossum guido at python.org
Wed Jul 25 16:06:19 EDT 2001


"Daniel Fackrell" <dfackrell at DELETETHIS.linuxmail.org> writes:

> Would this unified number system somehow still be able to provide the
> functionality that ints provide with regard to bitwise operations?  There
> may be other problems that arise as well, but I'm too much of a newbie to
> point them out at this time.

Yes, all bitwise operations are defined on longs, and they would work
the same.  This means some semantic changes for << (which loses bits
"shifted out" with ints but not with longs) and it would be somewhat
difference for negative numbers, but all the basic shifting and
masking operations would all be accessible.  Also, masking everything
with 0xffffffff after the operation should give back the old 32-bit
int semantics.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list