[Python-ideas] Fixing class scope brainstorm

Paul Moore p.f.moore at gmail.com
Tue Mar 27 14:47:55 EDT 2018


On 27 March 2018 at 19:43, Ethan Furman <ethan at stoneleaf.us> wrote:
> On 03/27/2018 11:12 AM, Ivan Levkivskyi wrote:
>>
>> On 27 March 2018 at 18:19, Guido van Rossum wrote:
>
>>> Hm, so maybe we shouldn't touch lambda, but we can at least fix the scope
>>> issues for comprehensions and genexprs.
>>
>>
>> Removing the implicit function scope in comprehensions is something I
>> wanted for long time.
>> It would not only "fix" the scoping, but will also fix the yield inside
>> comprehensions.
>
> Can we do it without leaking names?

To me, that would be the ideal. I assume there are significant
technical challenges, though, as otherwise I'd have thought that would
have been the approach taken when Python 3 fixed the name leaking
issue from Python 2.

Paul


More information about the Python-ideas mailing list