Python-list Digest, Vol 18, Issue 208

"Martin v. Löwis" martin at v.loewis.de
Tue Mar 15 19:06:55 EST 2005


Jeff Shannon wrote:
> I'd be in favor of that, unless someone can come up with a compelling 
> current use-case for octal literals.

Existing code. It may use octal numbers, and it would break if they 
suddenly changed to decimal. Not only that - breakage would be *silent*,
i.e. the computations would just use incorrect numbers. You could make
breakage explicit, by disallowing leading zeroes in integer literals -
but still, programs would break.

As for functional use-cases: os.chmod is the typical example:

   os.chmod("/tmp/bla", 0660)

gives rw-rw---- access to /tmp/bla. Unix permission line up nicely
with octal numbers.

Regards,
Martin



More information about the Python-list mailing list