On 17 Sep 2005 02:04:39 -0700 "Simon Percivall" <percivall at gmail.com> wrote: > Have you read the "Metaclasses" part of "Unifying types and classes in > Python 2.2"? (http://www.python.org/2.2.3/descrintro.html#metaclasses) Yes, I read. Have you read and understood my message ? :) A class B, subclass of class A, with a metaclass M_A should have M_A or a subclass of it as metaclass. If you try with anything else, you get a TypeError exception as expected. OK. But if you try with 'type', nothing happens. Python 2.4.1 (#1, Sep 16 2005, 17:47:47) [GCC 3.3.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class M_A(type): pass ... >>> class A: __metaclass__ = M_A ... >>> class B(A): __metaclass__ = type ... >>> B.__class__ <class '__main__.M_A'> >>> B.__metaclass__ <type 'type'> Regards, -- Pedro Werneck
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4