Annoying octal notation

MRAB python at mrabarnett.plus.com
Fri Aug 21 17:18:41 EDT 2009


Piet van Oostrum wrote:
>>>>>> Derek Martin <code at pizzashack.org> (DM) wrote:
> 
>> DM> I fail to see how 0O012, or even 0o012 is more intelligible than 012.
>> DM> The latter reads like a typo, and the former is virtually
>> DM> indistinguishable from 00012, O0012, or many other combinations that
>> DM> someone might accidentally type (or intentionally type, having to do
>> DM> this in dozens of other programming languages).  
> 
> You're right. Either hexadecimal should have been 0h or octal should
> have been 0t :=)

I have seen the use of Q/q instead in order to make it clearer. I still
prefer Smalltalk's 16rFF and 8r377.



More information about the Python-list mailing list