[Python-ideas] π = math.pi
Dan Sommers
dan at tombstonezero.net
Sat Jun 3 15:02:28 EDT 2017
On Sat, 03 Jun 2017 17:45:43 +0000, Brett Cannon wrote:
> On Fri, 2 Jun 2017 at 15:56 Guido van Rossum <guido at python.org> wrote:
>
>> I would love to show how easy it is to write
>>
>> from math import pi as π, gamma as Γ
[...]
>> but I had to cheat by copying from the OP since I don't know how to type
>> these (and even if you were to tell me how I'd forget tomorrow). So, I am
>> still in favor of the rule "only ASCII in the stdlib".
>
> Since this regularly comes up, why don't we add a note to the math module
> that you can do the above import(s) to bind various mathematical constants
> to their traditional symbol counterparts? ...
Because in order to add that note to the math module, you have to
violate the "only ASCII in the stdlib" rule. ;-)
People who would benefit from seeing ϖ (or π) in their code will arrange
to type it in proportion to that benefit (and probably already have). I
know how to type those characters in my environments, but it might not
be that easy if I had to do so on a random computer with a random
keyboard running a random OS. Ob XKCD: https://xkcd.com/1806/ (my
apologies if someone else already brought this up; I haven't been
following along that closely).
And I want to say something about this argument being like the one about
being able to represent people's names correctly, but while the ratio
between the circumference of a circle to its diameter has a name, it
isn't a person.
Dan
More information about the Python-ideas
mailing list