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

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Jun 27 19:31:43 EDT 2018


Steven D'Aprano wrote:
> The *very first* motivating example for this proposal came from a 
> comprehension.
> 
> I think it is both unfortunate and inevitable that the discussion bogged
> down in comprehension-hell.

I think the unfortunateness started when we crossed over from
talking about binding a temporary name for use *within* a
comprehension or expression, to binding a name for use *outside*
the comprehension or expression where it's bound.

As long as it's for internal use, whether it's in a comprehension
or not isn't an issue.

> Tim Peters has also given a 
> couple of good examples of mathematical code that would benefit strongly 
> from this feature.
> 
> Going back a few months now, they were the examples that tipped me over

Well, I remain profoundly unconvinced that writing comprehensions
with side effects is ever a good idea, and Tim's examples did
nothing to change that.

-- 
Greg



More information about the Python-Dev mailing list