PEP 289: Generator Expressions (please comment)

Patrick Maupin pmaupin at speakeasy.net
Mon Oct 27 23:22:26 EST 2003


> How is using [...] to construct a list "somewhat goofy"?  For list
> comprehensions using square brackets to surround the expression make sense
> to me.  If they hadn't been done that way, you might be looking at using
> them to distinguish generator expressions from bracket-less list
> comprehensions. ;-)

Yes, it makes perfect, logical, rational sense, in the same sort of
way that XML makes sense -- to a machine.  Having used list comprehensions
rather a lot for a few months now, I still feel they "look goofy"
as well.  They are not at all aesthetically pleasing, in fact rather
jarring, imo.  As did many others on this list, I took to most of
Python's syntax immediately, but list comprehensions don't fall into
that category.  I couldn't begin to tell you why that is the case.

I think that once the new generator expressions are available
(if it happens in the form as proposed), I will actually be
_converting_ a lot of list comprehensions into generator-expression
form as I do code maintenance.

Of course, ymmv and all that...

Pat




More information about the Python-list mailing list