<p dir="ltr"><br>
On 13 May 2013 03:23, "Juancarlo Aņez" <<a href="mailto:apalala@gmail.com">apalala@gmail.com</a>> wrote:<br>
><br>
><br>
> On Sun, May 12, 2013 at 10:09 AM, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br>
>><br>
>> > I've tried everything, so I'm pretty sure that there's no clean solution in<br>
>> > 2.7/3.3.<br>
>><br>
>> Correct. This is why PEP 403 exists.<br>
><br>
><br>
> PEP 403 sucks! <br>
><br>
> It's a very ill attempt at replacing the need for anonymous blocks, which could be done syntax very like the current one.</p>
<p dir="ltr">Anonymous blocks in Ruby depend on the convention that the block is always the last positional argument. Python has no such convention, thus any "block like" solution will require a mechanism that allows the user to tell the interpreter where the trailing callable should be referenced in the preceding simple statement.</p>

<p dir="ltr">Earlier versions of PEP 403 used a magic symbol for this, but that ended up being ugly and non-obvious. Thus, I changed it to the current explicit forward reference. For throwaway callbacks, using a short meaningless name like "f" should be sufficiently brief, and in many cases a more meaningful name may be used in order to make the code more self-documenting.</p>

<p dir="ltr">Now, do you have any constructive feedback on the PEP that still accounts for Python's lack of a standard location for passing callables to functions, or is this reaction simply a matter of "I don't want to have to type 'f' twice because I don't have to do that in other languages"?</p>

<p dir="ltr">Regards,<br>
Nick.</p>
<p dir="ltr">><br>
> ATIAIHTSAT!<br>
><br>
> This thread is closed, AFAIC. I am in peace with the must-be-functions of Python blocks. Smarter people than me will figure things out.<br>
><br>
> Cheers,<br>
><br>
> -- <br>
> Juancarlo Aņez</p>