[Python-ideas] π = math.pi

Chris Angelico rosuav at gmail.com
Thu Jun 1 12:53:43 EDT 2017


On Fri, Jun 2, 2017 at 2:40 AM, Random832 <random832 at fastmail.com> wrote:
> On Thu, Jun 1, 2017, at 10:08, Masayuki YAMAMOTO wrote:
>> The width of Greek letters is East Asian Ambiguous. Using ambiguous width
>> characters possibly will be a reason that is source code layout break on
>> specific locale.
>
> I don't think PEP 8 approves anyway of doing the kind of column
> alignment that this (or for that matter proportional fonts) would break.
> One example is specifically called out as a "pet peeve".
>
> Of course, it also doesn't exactly approve of non-ASCII identifiers (PEP
> 3131 specifically forbids them in the standard library).

PEP 8 has nothing against non-ASCII identifiers where they make sense.
The Py3 grammar was changed to be full Unicode specifically to permit
that sort of thing. Personally, I would continue to use math.pi
because it's easier to type *on my keyboard* than something involving
letters I have to compose, but it may well be different for someone
who already shifts keyboard from Latin to Greek regularly.

Regardless, the stdlib does, as you say, avoid non-ASCII.

ChrisA


More information about the Python-ideas mailing list