Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=python.org; s=200901; t=1361530859; bh=Jng6zQuEEMljFSYyLRJB4rMeHLowCPDHOvbNktkvGDY=; h=To:From:Subject:Date:Message-ID:References:Mime-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=Tvyk5mBXlE0Wl5q7tuwBLqwnSe9Efm8gd74psD//99NCJbP1h+kbVFV+IfJcNhoUy dZWePsIU16PRmfQ7Br0oQwE9vWUWlr27kWnvE3PfE9O+R6i6qIX5RhugdDapgtcRP7 CFsgkwj9fhQUaL9QBx2gXxfw1vRTgX62O94k9IfI= X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'cpython': 0.05; 'allowed.': 0.07; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'stored': 0.10; 'also:': 0.16; 'from:name:christian heimes': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'structure.': 0.16; 'subclassing': 0.16; "type's": 0.16; 'from:addr:python.org': 0.17; 'code.': 0.20; 'so.': 0.24; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; 'to:addr :python-list': 0.33; 'received:org': 0.36; 'but': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'information': 0.63 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Christian Heimes Subject: Re: subclassable types Date: Fri, 22 Feb 2013 12:00:35 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: f048224074.adsl.alicedsl.de User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361530860 news.xs4all.nl 6972 [2001:888:2000:d::a6]:54438 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39540 Am 22.02.2013 10:35, schrieb Wolfgang Maier: > Also: can you use introspection to find out whether a type is valid as a > base type? I don't think so. For CPython the information is stored in the type's structure. When type->tp_flags & Py_TPFLAGS_BASETYPE is true then subclassing is allowed. But I know of no way to retrieve that information from Python code.