[Python-Dev] Negative long literals (was Re: Does Python need a '>>>' operator?)

Guido van Rossum guido@python.org
Mon, 10 Jun 2002 08:52:43 -0400


> I think Beni has a very nice idea here, especially for people who can't
> visualize 2's-complement (not mentioning Guido by name <wink>).

In fact it's so subtle that I didn't notice what he proposed.  I
though it had to do with the uppercase of 1xABCD.

Maybe that's too subtle?

Do we really need this?

> > I just got another idea: use 0x1234 for 0-filled numbers and 1xABCD for
> > 1-filled ones.  That way you impose no restrictions on what follows the
> > prefix and keep backward compatibility.  0xFFFFFFFF stays a 2^n-1
> > _positive_ number, as it should be.  The look of 1x is weird at first but
> > it is very logical...
> > 
> > Beni Cherniavsky <cben@tx.technion.ac.il>

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