[Python-ideas] Partial operator (and 'third-party methods' and 'piping') [was Re: Function composition (was no subject)]

Spencer Brown spencerb21 at live.com
Tue May 12 11:30:55 CEST 2015


It might be neat to be able to use the superscript and subscript number glyphs for exponentiation and indexing, so 'x₀, x₁, x₂' == 'x[0], x[1], x[2]' and 'some_var³⁵˙¹' == 'some_var ** 35.1'. (That probably shouldn't support anything other than numbers and '.' to keep things simple). There's also the comparison operators (≠, ≤, ≦, ≥, ≧), '∈' for in and perhaps even additional overloads for sets (∪, ∩, ⊂, ⊆, ⊃, ⊇, ⊖).
Maybe the math module could have a math.π alias as well for people who wish to import it.

- Spencer

> On 12 May 2015, at 7:01 pm, João Santos <jmcs at jsantos.eu> wrote:
> 
> Python already supports unicode operators (kind of). You just have to use a custom codec that translates the unicode characters to proper python.
> 
>> On Tue, 12 May 2015 at 10:42 Philipp A. <flying-sheep at web.de> wrote:
>> ha, i love unicode operators (e.g. in scala), but i think guido said python will stay ASCII.
>> 
>> i hope we one day gain the ability to optionally use unicode alternatives, even if that would put an end to our __matmul__ → function combination aspirations:
>> 
>> * → ·
>> @ → × (not ∘)
>> / → ÷
>> ... → …
>> lambda → λ
>> 
>> – phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150512/d59b7e40/attachment-0001.html>
-------------- next part --------------
_______________________________________________
Python-ideas mailing list
Python-ideas at python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list