18 Feb
2014
18 Feb
'14
5:36 a.m.
On Tue, Feb 18, 2014 at 10:54 AM, Nick Coghlan
I haven't studied the compiler closely enough to tell how difficult this would be to achieve, though. Whoever implemented inner scopes for list comprehensions reportedly found it harder than he liked at the time.
That was me, and it's handling nested closures correctly that gets excruciatingly difficult. In theory, the compiler has enough info to figure out the details and generate appropriate inline code, but in practice, reusing the existing closure support made the change so much simpler to implement that was the option I eventually chose.
Thanks Nick. Useful explanation, and now linked to in the PEP draft. https://github.com/Rosuav/ExceptExpr/raw/master/pep.txt ChrisA