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

Michael Gilfix mgilfix@eecs.tufts.edu
Mon, 10 Jun 2002 08:56:40 -0400


On Mon, Jun 10 @ 08:16, Tim Peters wrote:
> 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>).

  I like the idea but I'm not sure that still solves the down casting
problem. Say I do some bit ops on a long type and want to get it
into an int size (for whatever reason and there are several), I need
somehow to tell python that it is not an overflow when I'm int()ing
the number. Perhaps int could take a second hidden argument. Be
able to do a:

  int(big_num, signed=1)

  which is pretty clear.

                       -- Mike

-- 
Michael Gilfix
mgilfix@eecs.tufts.edu

For my gpg public key:
http://www.eecs.tufts.edu/~mgilfix/contact.html