[Python-Dev] Cannot declare the largest integer literal.

Greg Stein gstein@lyra.org
Mon, 8 May 2000 14:54:31 -0700 (PDT)

On Mon, 8 May 2000, Christian Tismer wrote:
> > So long as negative literals don't exist in the grammar, "-2147483648" makes
> > no sense on a 2's-complement machine with 32-bit C longs.  There isn't "a
> > problem" here worth fixing, although if there is <wink>, it will get fixed
> > by magic as soon as Python ints and longs are unified.
> I'd change the grammar.

That would be very difficult, with very little positive benefit. As Mark
said, use 0x80000000 if you want that number.

Consider that the grammar would probably want to deal with things like
  - 1234

Instead, the grammar sees two parts: "-" and "NUMBER" without needing to
complicate the syntax for NUMBER.


Greg Stein, http://www.lyra.org/