Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'bug': 0.02; 'url:bugs': 0.05; 'terry': 0.07; 'bug:': 0.09; 'subject:error': 0.11; 'described': 0.14; 'wrote:': 0.14; 'calculation': 0.16; 'creation.': 0.16; 'implied.': 0.16; 'metaclass': 0.16; 'metaclasses': 0.16; 'patch,': 0.16; 'reedy': 0.16; 'subclasses.': 0.16; 'cc:addr:python-list': 0.17; 'header:In-Reply-To:1': 0.21; 'cc:2**0': 0.22; 'code.': 0.22; 'cc:no real name:2**0': 0.23; '(or': 0.24; 'code': 0.24; 'specified': 0.26; 'message- id:@mail.gmail.com': 0.28; 'sat,': 0.29; 'class': 0.29; 'least': 0.30; 'cc:addr:python.org': 0.30; 'daniel': 0.34; 'received:209.85.216.46': 0.34; 'received:mail- qw0-f46.google.com': 0.34; 'there': 0.35; 'doc': 0.35; 'instances': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.37; 'another': 0.37; 'think': 0.38; 'url:python': 0.38; 'url:org': 0.38; 'but': 0.38; 'docs': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'called': 0.39; 'received:209': 0.39; 'report': 0.40; 'really': 0.40; 'happen': 0.60; 'within': 0.60; 'details': 0.64; '11,': 0.68; 'that),': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=8fuCp+4LzdfYvTZLUz2Ix+/C6UBUgrsVBXfrqMXcK1g=; b=OZ13YrzGql2scetTEhNSA1mT7JV5EqYkMgZiJ47HEgGq3U07m6psgkfSoc0E8BAJMC HzdUKzta9MFOMPAG4MBtI1mjYN/Ns2QdHglY+ES7HotPCMBIAIiZOOiHG0rHSzhuFXVa u9Gr+IFP9P5L82jOO5dtuRb0e1dJdGBwKanqc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=PdQCMLrJqrYwXbbBujgRP9a5tlPg3+Ylgro5NriQ2wUjIrL3Qx/FoFrXrEgdKbdzPl xSlMKHPDGfwbTGi6eiWoN/3tNrE8DtLIJeKbp+67vTlOlhGANly9cc+Qxoo9oLnynHTs YKWr/CbdzCQjO+xbptDOMsfn6WM/RkexB4dxU= MIME-Version: 1.0 In-Reply-To: References: <4df2e251$0$30002$c3e8da3$5496439d@news.astraweb.com> <4df353b4$0$30002$c3e8da3$5496439d@news.astraweb.com> From: Daniel Urban Date: Sat, 11 Jun 2011 22:51:01 +0200 Subject: Re: Recursion error in metaclass To: Terry Reedy Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org 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: 18 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307825484 news.xs4all.nl 49179 [::ffff:82.94.164.166]:42332 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7462 On Sat, Jun 11, 2011 at 21:39, Terry Reedy wrote: > What may not be obvious from the docs is that the metaclass calculation > described in the doc section on class statements is carried out within > type.__new__ (or after a possible patch, called from within that), so that > type calls are really "a dynamic form of the class statement" even when > another another metaclass is specified or implied. "Return a new type > object." includes instances of type subclasses. I am not sure what happens > with metaclasses that are not type subclasses. There is at least one bug > report about the metaclass calculation, which is why I happen to have read > the typeobject.__new__ code. But I have not read the build-class code and > all the details of class creation. So I may have some of the details above > wrong. Just for the record, I think this is the mentioned bug: http://bugs.python.org/issue1294232 Daniel