Question about idioms for clearing a list

Ed Singleton singletoned at gmail.com
Tue Feb 7 17:06:44 EST 2006


On 07/02/06, Raymond Hettinger <python at rcn.com> wrote:
> > Again we unfortunately have a bit of an attitude problem
> > > towards anyone posting here that doesn't know whatever the experts
> > > think is obvious.
> >
> > I agree wholeheartedly with this, particularly as there often seems to
> > be strong (and confusing) resistance to making Python easier and more
> > obvious.
>
> That is B.S.
>
> We simply disagree on whether list.clear() is an improvement.  Adding a
> non-essential method to an important API does not make the language
t > easier to learn or use.

Yes it does.  It makes it a lot easier to learn.  Even list.del()
would be a massive improvement.

> Also, it doesn't address the wider issue that
> learning about slices is important for understanding the language (it
> appears in many guises).  Likewise, learning about the del-statement is
> somewhat essential for people setting out to mutate collections
> in-place. You're not helping someone if you steer them away from
> learning the basics.

Maybe it's better to put the basics in a place that they will find
them, rather than trying to steer them.  Manipulating the language is
hell of a lot easier than manipulating every user.

Languages are only there for people to use therefore I'm going to go
out on a limb and say that they should be designed for people to use.

> >  I can only assume that it is by people who have forgotten
> > what it is like to be an average programmer.
>
> More B.S.
>
> My thoughts on the issue are informed by several years of answering
> average programmer questions on the python-help list.  In that time,
> the question of how to clear a list has never come up.  There are
> several areas of recurring confusion but this isn't one of them.
> You're mud-slinging over a non-issue.

My thoughts on the issue are informed by many years of being an
average programmer and knowing and working with lots of average
programmers (and well below average programmers for that matter)

I'm not mud-slinging, I'm just saying that people are very dismissive
of making the language easier to use for newbies.

Ed



More information about the Python-list mailing list