Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: checking if a list is empty Date: Thu, 12 May 2011 17:44:07 +1200 Lines: 14 Message-ID: <931adaF9g1U1@mid.individual.net> References: <200e93c2-6b87-4113-9c6f-85815e51ea77@28g2000yqu.googlegroups.com> <4dc4b3c5$0$29991$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net cWi1Ilemld7l13+1JJBM+w6nGPfkxW8vyvszWicVFMMfTCNLaq Cancel-Lock: sha1:wpqWuB3nDUc2eKuXylLOeqsk1Vk= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5198 Roy Smith wrote: > Hans Georg Schaathun wrote: >>If both are numbers, they are converted to a common type. Otherwise, >>objects of different types always compare unequal That's just the default treatment for unrelated types that don't know anything about each other. I would guess that the list's == method is asking "Is the other object a list?", and since a subclass of list is also a list, it's happy and goes on to compare the elements. -- Greg