Does Python need a '>>>' operator?

Bengt Richter bokr at oz.net
Mon Apr 15 13:59:45 EDT 2002


On 15 Apr 2002 08:24:53 +0200, martin at v.loewis.de (Martin v. Loewis) wrote:

>bokr at oz.net (Bengt Richter) writes:
>
>> If hex long representation were interpreted to represent actual twos
>> complement bits, with the top hex digit 8-bit being extended indefinitely
>> to the left, you could have hex(-1L) be represented as 0xFL (which would
>> require that hex(15L) be represented as 0x0FL).
>
>So you would you represent +7 and -7 in hex?
   ^--I assume missing 'how' ;-)

newhex(+7) => 0x7 # implied extension of msb => 0x000...007
newhex(-7) => 0x9 # implied extension of msb => 0xfff...ff9

I realize there would be code breakage using 0x, since that, e.g.,
changes the current meaning of 0x9. So I thought to introduce
an alternate '0x' hex prefix in the form of '0h'.

Regards,
Bengt Richter



More information about the Python-list mailing list