Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-transit.tcx.org.uk!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:object': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:None': 0.09; 'classes,': 0.13; 'subject:not': 0.21; 'extension': 0.21; 'header:In-Reply-To:1': 0.22; '(on': 0.23; 'noticed': 0.24; 'windows': 0.26; 'testing': 0.26; 'subject:Test': 0.30; 'types.': 0.30; 'chris': 0.30; 'certainly': 0.32; "isn't": 0.33; 'header:User-Agent:1': 0.33; 'actually': 0.33; 'header:X -Complaints-To:1': 0.33; 'there': 0.33; 'done': 0.34; 'to:addr :python-list': 0.34; 'certain': 0.34; 'url:python': 0.36; 'think': 0.37; 'received:org': 0.38; 'some': 0.38; 'url:docs': 0.39; 'received:de': 0.39; 'url:org': 0.39; 'to:addr:python.org': 0.40; 'types': 0.61; 'special': 0.68; 'deliberate': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Christian Heimes Subject: Re: Test None for an object that does not implement == Date: Mon, 26 Dec 2011 01:37:03 +0100 References: <0d80ce25-9e65-4216-b26c-b8ee40f989a3@q9g2000yqe.googlegroups.com> <4ef729aa$0$29973$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: f049164071.adsl.alicedsl.de User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 In-Reply-To: X-Enigmail-Version: 1.4a1pre OpenPGP: id=AD16AB1B; url=http://cheimes.de/heimes.asc X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1324859838 news.xs4all.nl 6913 [2001:888:2000:d::a6]:39514 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17933 Am 25.12.2011 15:04, schrieb Chris Angelico: > I think there are certain types that are actually not implemented as > classes, and hence cannot be subclassed. This is almost certainly an > implementation detail though; my testing was done in Py3.2 (on Windows > fwiw). Some extension types are not subclass-able on purpose. The feature isn't available to heap types. http://docs.python.org/c-api/typeobj.html#Py_TPFLAGS_BASETYPE Most people have never noticed the deliberate limitation because only a few special types are sub-classable. Christian