On 27 March 2018 at 01:57, Guido van Rossum <gu...@python.org> wrote: > On Mon, Mar 26, 2018 at 7:57 AM, Nick Coghlan <ncogh...@gmail.com> wrote: >> By contrast, the sublocals idea strives to keep the *lifecycle* impact >> of naming a subexpression as negligible as possible - while a named >> subexpression might live a little longer than it used to as an >> anonymous subexpression (or substantially longer in the case of >> compound statement headers), it still wouldn't survive past the end of >> the statement where it appeared. > > > But this is not new: if you use a for-loop to initialize some class-level > structure you have the same problem. There is also a standard solution > (just 'del' it).
Right, but that's annoying, too, and adds "Am I polluting a namespace I care about?" to something that would ideally be a purely statement local consideration (and currently is for comprehensions and generator expressions). 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/