List comprehensions' ugliness (Was: Re: How to explain exactly what "def" does?)

J.Jacob joost_jacob at hotmail.com
Fri Feb 7 11:47:00 EST 2003


[Tim Peters]
> It has different semantics.  If it's your intent to extend a list in-place,
> then .extend or += are necessary.  If it's your intent to create a new list
> object, then .extend and += must not be used.  If it doesn't matter to your
> app whether you create a new object, suit yourself.

I find it hard to believe that ``listx = listx + thing`` does not have
the same semantics as ``listx += thing``.  I have not followed all the
fancy syntax extensions, partly because I have to use Python 1.5.2
often.  But what is going on at python-dev?  Do they really want all
people coming from C++ to fall into this ``+=`` trap?

<rant>
Instead of extending syntax, maybe it would be better to concentrate
on bugreports and the standard library?  There are a lot of people who
are quite happy with Python already.  Hold the class changes until
things are complete so you can unify types and classes in *one*
version instead of all these inbetween thingies?  Make sure you keep
your good position in the XML world?
</rant>

bring-me-1-5-3




More information about the Python-list mailing list