[Python-ideas] Partial operator (and 'third-party methods' and 'piping') [was Re: Function composition (was no subject)]
Philipp A.
flying-sheep at web.de
Tue May 12 10:36:22 CEST 2015
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
Rustom Mody <rustompmody at gmail.com> schrieb am Di., 12. Mai 2015 um
07:07 Uhr:
> On Mon, May 11, 2015 at 8:11 PM, Guido van Rossum <guido at python.org>
> wrote:
>
>>
>>
>> As long as I'm "in charge" the chances of this (or anything like it)
>> being accepted into Python are zero. I get a headache when I try to
>> understand code that uses function composition,
>>
>
> I find it piquant to see this comment from the creator of a language that
> traces its lineage to Lambert Meertens :-)
> [Was reading one of the classics just yesterday
>
> http://www.kestrel.edu/home/people/meertens/publications/papers/Algorithmics.pdf
> ]
> Personally, yeah I dont think python blindly morphing into haskell is a
> neat idea
> In the specific case of composition my position is...
>
> sqrt(mean(square(x)))
> is ugly in a lispy way
>
> (sqrt @ mean @ square)(x)
> is backward in one way
>
> (square @ mean @ sqrt)(x)
> is backward in another way
>
> sqrt @ mean @ square
> is neat for being point-free and reads easy like a Unix '|' but the '@' is
> more strikingly ugly
>
> sqrt o mean o square
> is a parsing nightmare
>
> square ∘ mean ∘ root
> Just right! [Assuming the unicode gods favor its transmission!]
>
> ...hopefully not too frivolous to say this but the ugliness of @ overrides
> the succinctness of the math for me
>
>
> _______________________________________________
> 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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150512/e4ef8954/attachment.html>
More information about the Python-ideas
mailing list