On 3 March 2018 at 10:09, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:

> Nick Coghlan wrote:
>
>> I don't think it should be possible to close over statement locals.
>>
>
> Why not?


I gave a more detailed answer to that in
https://mail.python.org/pipermail/python-ideas/2018-March/049138.html, but
the short version is:

* prohibiting closing over them opens up a lot of opportunities to simplify
the implementation
* prohibiting closing over them increase their semantic distance from
regular function locals, making it easier for people to answer the question
"Should I use a function local or a statement local?" in the future

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to