[Python-ideas] A more readable way to nest functions

Chris Angelico rosuav at gmail.com
Sat Jan 28 07:55:50 EST 2017


On Sat, Jan 28, 2017 at 11:41 PM, Ed Kellett <edk141 at gmail.com> wrote:
> FWIW, I'd spell it without the (), so it's simply a right-associative binary
> operator on expressions, (a -> b, a) -> b, rather than magic syntax.
>
>     print XYZ some_func XYZ another_func("Hello")

I'm not entirely sure I understand your example; are you using "XYZ"
as an operator, or a token (another parameter)? I think probably the
former, but you may mean this differently.

In any case, it's a new syntax that does exactly the same thing that
we can already do, just with more restrictions, and arguably more
readably. That means it has to have a SIGNIFICANT advantage over the
current syntax - a pretty high bar. I don't see that it's cleared that
bar; it is, at best, a small and incremental change.

ChrisA


More information about the Python-ideas mailing list