[Python-3000] Octal (original) (raw)

Patrick Maupin pmaupin at gmail.com
Wed Mar 14 07:08:19 CET 2007


On 3/14/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

1101(2) # binary 1234(8) # octal 1c3a(16) # hexadecimal 12g7(35) # why stop at 16?

Since calling a built-in integer never makes sense, this would be unambiguous.

That's a great idea all the way around. Another possible syntax would be 1101 at 2, 1234 at 8, etc. I don't think that could mean anything currently.

Perhaps an all-digits literal with a leading zero should be disallowed altogether. That ought to prevent any accidents.

Yeah, you can't change it; you have to deprecate it and then start raising an exception.

Pat



More information about the Python-3000 mailing list