Octal notation: severe deprecation

JCM joshway_without_spam at myway.com
Fri Jan 14 14:53:02 EST 2005


and-google at doxdesk.com wrote:
...
> In Mythical Future Python I would like to be able to use any base in
> integer literals, which would be better. Example random syntax:

> flags= 2x00011010101001
> umask= 8x664
> answer= 10x42
> addr= 16x0E800004  # 16x == 0x
> gunk= 36x8H6Z9A0X

I'd prefer using the leftmost character as a two's complement
extension bit.

0x1  : 1 in hex notation
1xf  : -1 in hex notation, or conceptually an infinitely long string of 1s
0c12 : 10 in octal noataion
1c12 : -54 in octal (I think)
0d12 : 12 in decimal
0b10 : 2 in binary
etc

I leave it to the reader to decide whether I'm joking.



More information about the Python-list mailing list