[Python-3000] Fwd: Re: Fwd: Re: Fwd: Re: Octal
Patrick Maupin
pmaupin at gmail.com
Thu Mar 15 20:26:14 CET 2007
On 3/15/07, Georg Brandl <g.brandl at gmx.net> wrote:
> My concern is that I don't want to have to write something like
>
> x = 0t755 # octal literal
>
> because then I can also write
>
> x = 493 # 0755 in octal
But, in general, code comments about how Python works are to be
discouraged. If 0t755 becomes part of the language, your first
example would be almost as silly as writing:
x += 1 # Increment X
However, even if you still feel the need to do this, I submit that it
takes less time and mental energy to indicate to your reader that it
is an octal number, than the time and mental energy for you to convert
0755 to 493, and (more importantly) for your reader to mentally
convert 493 BACK to 0755 just to check that the comment is not lying.
(A knowledgeable Python reader can verify the veracity of your "#
octal literal" comment in milliseconds, but not your other comment.)
Regards,
Pat
More information about the Python-3000
mailing list