Leading 0's syntax error in datetime.date module (Python 3.6)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri May 11 02:19:28 EDT 2018


On Thu, 10 May 2018 23:23:33 -0600, Ian Kelly wrote:

> On Thu, May 10, 2018 at 9:21 PM, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>> On Thu, 10 May 2018 11:03:54 -0600, Ian Kelly wrote about proposed
>> prefixes for octal:
>>
>>> Personally I would have preferred the "t".
>>
>> "t" for octal, hey?
>>
>> That would be annoying if we ever get trinary literals.
>>
>> n for binary
>> t for octal
>> i for trinary
>> or should that be r for ternary?
>> o for duodecimal
> 
> I prefer it because it's the first letter of a syllable and it's not
> "o", not because it's the third letter of the word.

You should have said. Since you quoted the PEP, I inferred you were 
agreeing with the PEP's suggestion:

    even to use a "t" for "ocTal" and an "n" for "biNary" to
    go along with the "x" for "heXadecimal".

Note the "go along with". The X of hexadecimal, and the N of binary, are 
the *last* letter of a syllable, not the first, so I didn't think that 
"first letter of a syllable" was the rule you were applying. If it were, 
you would have picked "C" for oc-tal, not t.

So I guess the rule is:

    "first letter of the word, if the word starts with
    B, or the last letter of the first syllable, if the
    syllable ends with X, or first letter of the second
    syllable if it starts with C, or some random letter
    so long as its not O"

:-)


> Most of those
> suggestions make no sense. Why would we ever want ternary literals
> anyway?

https://en.wikipedia.org/wiki/Ternary_numeral_system#Practical_usage



-- 
Steve




More information about the Python-list mailing list