[docs] List tutorial

Eli Bendersky eliben at gmail.com
Mon May 9 15:00:22 CEST 2011

On Fri, May 6, 2011 at 03:58, Matthew Gilson <mlr54 at cisunix.unh.edu> wrote:

> at:
> http://docs.python.org/release/2.6/tutorial/datastructures.html#more-on-lists
> Perhaps this is nit-picky, but ...
> The documentation says that list.remove(x) removes the first item whose
> value is x.  In reality, that method removes the first item whose value
> equals x.
> simple example:
> class test(object):
>   def __eq__(self,other):
>      return True
> l=[test(),test()]
> l.remove(True)
> l.remove(True)
> print l # [] <<< Empty list.  test class instances were removed because
> they equal True, not because they are True!
> Perhaps that is what is meant by whose "value" is x, but I think the
> wording there is a little ambiguous.

I agree it's nit-picky :-)

At the tutorial level, "value is x" is good enough for the readers. Twisting
the tongue to avoid confusion between "is" and "equals" is IMHO unnecessary.

So -1 from me.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20110509/23822f22/attachment.html>

More information about the docs mailing list