Octal notation: severe deprecation

Steve Holden steve at holdenweb.com
Thu Jan 13 15:56:15 CET 2005

and-google at doxdesk.com wrote:

> John Machin wrote:
>>I regard continued usage of octal as a pox and a pestilence.
> Quite agree. I was disappointed that it ever made it into Python.
> Octal's only use is:
> a) umasks
> b) confusing the hell out of normal non-programmers for whom a
> leading zero is in no way magic
> (a) does not outweigh (b).
> 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
> But either way, I want rid of 0->octal.
>>Is it not regretted?
> Maybe the problem just doesn't occur to people who have used C too
> long.

> OT: Also, if Google doesn't stop lstrip()ing my posts I may have to get
> a proper news feed. What use is that on a Python newsgroup? Grr.

I remember using a langauge (Icon?) in which arbitrary bases up to 36 
could be used with numeric literals. IIRC, the literals had to begin 
with the base in decimnal, folowed by a "b" followed by the digits of 
the value using a through z for digits from ten to thirty-five. So

gunk = 36b8H6Z9A0X

would have been valid.

nothing-new-under-the-sun-ly y'rs  - steve
Steve Holden               http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC      +1 703 861 4237  +1 800 494 3119

More information about the Python-list mailing list