[Python-ideas] Fwd: Fwd: Fwd: unpacking generalisations for list comprehension

Nick Coghlan ncoghlan at gmail.com
Tue Oct 18 02:10:06 EDT 2016


On 18 October 2016 at 03:49, Random832 <random832 at fastmail.com> wrote:
> On Mon, Oct 17, 2016, at 13:32, Steven D'Aprano wrote:
>> This isn't a small change: it requires not
>> insignificant changes to people's understanding of what list
>> comprehension syntax means and does.
>
> Only if their understanding is limited to a sequence of tokens that it
> supposedly expands to [except for all the little differences like
> whether a variable actually exists]

Hi, I contributed the current list comprehension implementation (when
refactoring it for Python 3 to avoid leaking the iteration variable,
as requested in PEP 3100 [1]), and "comprehensions are syntactic sugar
for a series of nested for and if statements" is precisely my
understanding of how they work, and what they mean. It is also how
they are frequently explained to new Python users.

Directly insulting me and many of the educators who do so much to
bring new users to Python by calling our understanding of a construct
I implemented (and that you apparently love using) limited, is *not*
doing your cause any favours, and is incredibly inappropriate
behaviour for this list.

Regards,
Nick.

[1] https://www.python.org/dev/peps/pep-3100/#core-language

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list