The title is misleading : it should be "nesting function calls" Elazar
בתאריך שבת, 28 בינו' 2017, 18:38, מאת Ed Kellett <edk...@gmail.com>: > On Sat, 28 Jan 2017 at 14:27 zmo via Python-ideas <python-ideas@python.org> > wrote: > > I agree this would look a bit more elegant. To focus on the feature of > that operator, instead of how to write it, I'll use XYZ instead of <| in > this post. > > > My thoughts exactly :) > > > So, considering it's decided that the RHS is in charge of filling up all > the arguments of the LHS, how to deal with positional and keyword > arguments without introducing new syntax? > > > My instinct is that we don't need to deal with that; that's what partial > application is for. To be fair, I'd advocate better syntax for that, but > it's another issue. > > > anyway, I guess it's pretty safe to assume that if fn_b() returns a > scalar, it'll be easy to assume it's just a single positional argument. > > > print XYZ some_func XYZ another_func("Hello") > > [...] > > > > Meaning that the above could also be written as: > > print XYZ some_func XYZ another_func XYZ "Hello" > > > That looks good to me, but I think another_func("Hello") is the better one > to recommend. I think it makes it slightly more obvious what is going on. > > > Then the basic operator definition could be done with a dunder > > looking like: [...] > > > I think the special-casiness here is unfortunate and would cause problems. > a(b()) doesn't randomly pass kwargs to a if b happens to return a certain > kind of thing. > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/