[Python-ideas] PEP 572: Statement-Local Name Bindings
Chris Angelico
rosuav at gmail.com
Wed Feb 28 15:34:59 EST 2018
On Thu, Mar 1, 2018 at 7:28 AM, Paul Moore <p.f.moore at gmail.com> wrote:
> I've no idea how that would work under statement-local names either, though.
>
> boom = lambda: boom()
> boom()
>
> is just an infinite recursion. I'm less sure that the as version is.
> Or the alternative form
>
> ((lambda: boom()) as boom)()
>
> I know you can tell me what the implementation does - but I can't
> reason it out from the spec.
The only part that isn't yet properly specified is how this interacts
with closures, and that's because I really don't know what makes
sense. Honestly, *any* situation where you're closing over a SLNB is
going to have readability penalties, no matter what the spec says.
ChrisA
More information about the Python-ideas
mailing list