On Thu, Nov 30, 2017, at 11:08, Eric Fahlgren wrote:
On Thu, Nov 30, 2017 at 2:48 AM, Andrea Griffini
wrote: Not really related but the PEP says that arguments in Python are evaluated before the function (as a reason to reject the idea of None-aware function call) but this is not the case:
I think you're missing something here, since it seems clear to me that indeed the arguments are evaluated prior to the function call. Maybe unrolling it would help? This is equivalent to the body of your lambda, and you can see that the argument is evaluated prior to the call which receives it.
Of course they're evaluated prior to the function *call*, but the pep says they're evaluated prior to the function *itself* [i.e. arg = g(); func = f(); func(arg)].