<div dir="ltr">The title is misleading : it should be "nesting function calls" </div><span>
</span><p dir="ltr">Elazar <br>
</p><span>
</span><br><div class="gmail_quote"><div dir="ltr">בתאריך שבת, 28 בינו' 2017, 18:38, מאת Ed Kellett ‏<<a href="mailto:edk141@gmail.com">edk141@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Sat, 28 Jan 2017 at 14:27 zmo via Python-ideas <<a href="mailto:python-ideas@python.org" class="gmail_msg" target="_blank">python-ideas@python.org</a>> wrote:</div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I agree this would look a bit more elegant. To focus on the feature of<br class="gmail_msg">
that operator, instead of how to write it, I'll use XYZ instead of <| in<br class="gmail_msg">
this post.</blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">My thoughts exactly :)</div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, considering it's decided that the RHS is in charge of filling up all<br class="gmail_msg">
the arguments of the LHS, how to deal with positional and keyword<br class="gmail_msg">
arguments without introducing new syntax?<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">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.</div><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">anyway, I guess it's pretty safe to assume that if fn_b() returns a<br class="gmail_msg">scalar, it'll be easy to assume it's just a single positional argument.<br class="gmail_msg">
<br class="gmail_msg">
>     print XYZ some_func XYZ another_func("Hello")<br class="gmail_msg">
<br class="gmail_msg"></blockquote></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[...]</blockquote></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
<br class="gmail_msg">
Meaning that the above could also be written as:<br class="gmail_msg">
<br class="gmail_msg">
    print XYZ some_func XYZ another_func XYZ "Hello"</blockquote></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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.</div><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Then the basic operator definition could be done with a dunder<br class="gmail_msg"></blockquote></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
looking like: [...]</blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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.</div></div></div>
_______________________________________________<br class="gmail_msg">
Python-ideas mailing list<br class="gmail_msg">
<a href="mailto:Python-ideas@python.org" class="gmail_msg" target="_blank">Python-ideas@python.org</a><br class="gmail_msg">
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" class="gmail_msg" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br class="gmail_msg">
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" class="gmail_msg" target="_blank">http://python.org/psf/codeofconduct/</a></blockquote></div>