Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!panix!roy From: Roy Smith Newsgroups: comp.lang.python Subject: Re: list equal to subclass of list? Date: Thu, 12 May 2011 21:53:05 -0400 Organization: PANIX Public Access Internet and UNIX, NYC Lines: 21 Message-ID: References: NNTP-Posting-Host: localhost X-Trace: reader1.panix.com 1305251585 23038 127.0.0.1 (13 May 2011 01:53:05 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 13 May 2011 01:53:05 +0000 (UTC) User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5277 In article , Ethan Furman wrote: > > [http://docs.python.org/library/stdtypes.html] > > Objects of different types, except different numeric types and different > > string types, never compare equal > > This part of the documentation is talking about built-in types, which > your MyList is not. > > > > [http://docs.python.org/release/2.7/reference/expressions.html#notin] > > objects of different types *always* compare unequal > > Should probably have the word 'built-in' precede 'types' here, since > constructed objects can do whatever they have been told to do. Changing the docs (in numerous places) to make it clear that this is only true of built-in types would indeed resolve the problem. As it reads now, it's a general statement about ALL types, built-in or user-defined.