Does Python need a '>>>' operator?
Martin v. Loewis
martin at v.loewis.de
Tue Apr 16 02:55:50 EDT 2002
David Eppstein <eppstein at ics.uci.edu> writes:
> > Unfortunately, you cannot represent such a number in hex, atleast not
> > under any of the usual conventions
[...]
> I don't understand why not.
[...]
>
> Similarly, the obvious and only way of representing a negative number in
> hex is to write a minus sign followed by the hex string for the absolute
> value of the number.
Right; this representation is natural for me as well. However, people
were objecting that hex() should not produce a sign: *that* is not
possible following the usual conventions.
> The "usual" way of representing 32-bit values in hex, ffff0123 etc, has
> nothing to do with negative numbers, it is a way of representing
> unsigned values. Since Python doesn't have unsigned values, we
> shouldn't do things that way.
I completely agree.
Regards,
Martin
More information about the Python-list
mailing list