Time we switched to unicode? (was Explanation of this Python language feature?)

Chris Angelico rosuav at gmail.com
Tue Mar 25 01:27:33 EDT 2014


On Tue, Mar 25, 2014 at 4:14 PM, Mark H Harris <harrismh777 at gmail.com> wrote:
> On 3/25/14 12:08 AM, Chris Angelico wrote:
>
>> How quickly can you switch, type one letter (to generate one Cyrillic
>> character), and switch back?
>
>
> ... very fast.
>
> Is not this nicer?
>
>>>> Π = pi
>>>>
>>>> sin(Π/4)
> 0.7071067811865475
>>>>
>>>> cos(Π/4)
> 0.7071067811865476
>>>>
>
>    my pdeclib constants extension will have alternate spellings for Π and Γ
> and Δ and others...

That's good! (Although typing Π quicker than pi is majorly pushing it.
I can type pi with two keystrokes. But for longer keywords, that's the
way it needs to be.) You can be at the front of the curve - using
non-ASCII symbols as identifiers, which a number of languages happily
support. Using them as keywords in the language means that it has to
be not just you, but the bulk of programmers; otherwise there have to
be two ways to do everything, and everyone has to learn both of them.
(Once, say, 99% of programmers can happily type all those symbols, the
fact that 1% of programmers are using the word "lambda" will just be a
matter to be dealt with in legacy code - same as seeing "range" vs
"xrange" in Python 2 code. New code needn't concern itself with the
difference.) Unfortunately, at the moment it's more like 1% of
programmers can easily type those symbols, I would guess.

ChrisA



More information about the Python-list mailing list