[Python-ideas] Re: Add Standard String Literals and Prefixes for Mathematical Notation

2020-02-25 Thread David Mertz
(Un)Happily we have the keyword "as" already. They can make their own aliases. On Tue, Feb 25, 2020, 11:46 PM Steven D'Aprano wrote: > On Tue, Feb 25, 2020 at 10:08:57PM -0500, David Mertz wrote: > > > >>> from statistics import stdev as σ > > >>> σ([5, 6, 4, 6, 3, 7]) > > 1.4719601443879744 >

[Python-ideas] Re: Add Standard String Literals and Prefixes for Mathematical Notation

2020-02-25 Thread Chris Angelico
On Wed, Feb 26, 2020 at 3:43 PM Steven D'Aprano wrote: > > On Tue, Feb 25, 2020 at 10:08:57PM -0500, David Mertz wrote: > > > >>> from statistics import stdev as σ > > >>> σ([5, 6, 4, 6, 3, 7]) > > 1.4719601443879744 > > > > :-) > > You know what you've done now, don't you? Somebody is going to

[Python-ideas] Re: Add Standard String Literals and Prefixes for Mathematical Notation

2020-02-25 Thread Steven D'Aprano
On Tue, Feb 25, 2020 at 10:08:57PM -0500, David Mertz wrote: > >>> from statistics import stdev as σ > >>> σ([5, 6, 4, 6, 3, 7]) > 1.4719601443879744 > > :-) You know what you've done now, don't you? Somebody is going to propose a whole series of aliased names for statistics and math modules:

[Python-ideas] Re: Add Standard String Literals and Prefixes for Mathematical Notation

2020-02-25 Thread David Mertz
> > For example, the function for calculating standard deviation is written > `statistics.stdev` not `σ`. > What do you mean? >>> from statistics import stdev as σ >>> σ([5, 6, 4, 6, 3, 7]) 1.4719601443879744 :-) -- Keeping medicines from the bloodstreams of the sick; food from the bellies

[Python-ideas] Re: Add Standard String Literals and Prefixes for Mathematical Notation

2020-02-25 Thread Steven D'Aprano
Hi Nathan, On Tue, Feb 25, 2020 at 11:58:58PM +, Nathan Edwards wrote: > I love regular expressions. Regexes' terse syntax are normally considered rather the opposite of Pythonic. > I would love to see Bra-Ket notation and many of the popular > mathematical forms commonly practiced in

[Python-ideas] Re: Add Standard String Literals and Prefixes for Mathematical Notation

2020-02-25 Thread Nick Timkovich
Can you provide short, but non-trivial, clear examples of "before" (current Python) and "after" (what you propose it looks like) to demonstrate the advantage? Will it be ambiguous with existing syntax? On Tue, Feb 25, 2020 at 6:10 PM Nathan Edwards wrote: > I love regular expressions. I would