[Python-Dev] Octal literals

Facundo Batista facundobatista at gmail.com
Wed Feb 1 02:11:24 CET 2006


2006/1/31, Bengt Richter <bokr at oz.net>:

> In that case, could I also make a pitch for the letter c which would similarly
> follow a radix (in decimal) but would introduce the rest of the number as
> a radix-complement signed number, e.g., -2, 16cfe, 8c76, 2c110, 10c98 would
> all have the same value, and the sign-digit could be arbitrarily repeated to
> the left without changing the value, e.g., -2, 16cfffe, 8c776, 2c1110, 10c99998
> would all have the same value. Likewise the positive values, where the "sign-digit"
> would be 0 instead of radix-1 (in the particular digit set for the radix). E.g.,
> 2, 16c02, 16c0002, 8c02, 8c0002, 2c010, 2c0010, 10c02, 10c00002, etc. Of course
> you can put a unary minus in front of any of those, so -16f7 == 1609, and
> -2c0110 == -6 == 2c1010 etc.

This is getting too complicated.

I dont' want to read code and pause myself 5 minutes while doing math
to understand a number.

I think that the whole point of modifying something is to simplify it.

I'm +0 on removing 0-leading literals. But only if we create "d", "h"
and "o" suffixes to represent decimal, hex and octal literals (2.35d,
3Fh, 660o). And +0 on keeping the "0x" preffix for hexa (c'mon, it
seems so natural....).

Regards,

.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/


More information about the Python-Dev mailing list