Python-list Digest, Vol 18, Issue 208
John Roth
newsgroups at jhrothjr.com
Mon Mar 14 06:29:40 EST 2005
"Charles Hartman" <charles.hartman at conncoll.edu> wrote in message
news:mailman.370.1110772426.1799.python-list at python.org...
>> I know this isnt that big of a problem,
>> but i cannot think of one reason why they would not allow numbers
>> preceded with a 0 to have a number
>> higher then a 7 in them...
>> And it seems very inconsistant to me...
>>
>> Is there a reason for this?
>>
> I *love* questions I can answer! Answer: because that's how you tell
> Python you're entering an octal number. (Parallel to 0x for hexadecimals.)
> So beware of 010, which isn't the number of fingers you presumably have,
> unless you don't count the thumbs.
That's a reason, but I don't consider it a good reason.
I cannot, in fact, think of a single time when I've wanted
to enter an octal number. Hex numbers, yes, but not
octal.
I personally don't think the frequency of use warrents
the special case syntax and the resultant confusion
with novices.
John Roth
>
> Charles Hartman
>
More information about the Python-list
mailing list