[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

On Mon, Jun 25, 2018 at 2:16 PM Steve Holden <steve at holdenweb.com> wrote:

> ?I'd like to ask: how many readers of ?
> ?this email have ever deliberately taken advantage of the limited Python 3
> scope in comprehensions and generator expressions to use what would
> otherwise be a conflicting local variable name??

?No, never, but the opposite has bitten me in production code (as I related
several months back, a class-level variable was being used on the lhs of a
comprehension and that failed when it was run in Py3).

The caveat is that our code base is Py2+Py3, so we have the mindset that
comprehension variables always leak.?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180625/bbfd251e/attachment.html>