Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.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 X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:How': 0.09; 'python': 0.09; 'subject:()': 0.09; 'subject:using': 0.09; 'def': 0.10; 'metaclass': 0.16; 'subject:class': 0.16; 'wrote:': 0.17; 'specify': 0.17; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'thanks!': 0.26; 'am,': 0.27; '>>>>': 0.29; 'skip:_ 10': 0.29; 'class': 0.29; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'message-id:@gmail.com': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'otten': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:newsgroups:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=snrUOR8zNpNzNJOuq+F6vL8liOdr79y3pY8X4JUZaHE=; b=clMbKRdeMTEjKgXZU4jNBk9XuE0lNpcn9+xCstIxbEC5wknPDctOOozHKCQZH9Mqo1 8PWvMINgdyKyajFQ4SgfEX5hQEQoTAREiTEdXi+IexNg2TJjpgt8tFRomoXmNib5Hgqu 2TR8kueNZPrwvDS0sy/oW+k9PH8b/TQmDRcVFnnOhNHDrgehxhCzOQZOujnYpmwk3CT7 UADQqFqjw/2QGYBv6t6Byh5Kj4wX0jbcqHbwpnl1+++0edhPQlCIZHyXLZB4n3I/6/aw /2XYxYBO3kAAfrTNzeIQy7ktVLItX1gwoLjh+FimNxJnb0own6SBMGnDX9aKANwdvyOb 9KIw== Date: Sat, 20 Oct 2012 13:19:05 +0200 From: Jennie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.python To: python-list@python.org Subject: Re: How to see the __name__ attribute of a class by using dir() References: <508267F8.5030302@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: , Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350731951 news.xs4all.nl 6950 [2001:888:2000:d::a6]:48951 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31809 On 10/20/2012 11:43 AM, Peter Otten wrote: > In Python 3 the way to specify the metaclass has changed: > >>>> class FooType(type): > ... def __dir__(self): return ["python"] > ... >>>> class Foo(metaclass=FooType): > ... pass > ... >>>> dir(Foo) > ['python'] Thanks! :) -- Jennie