This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author daniel.urban
Recipients daniel.urban, ezio.melotti, flox, ncoghlan
Date 2013-02-17.15:45:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361115919.16.0.540491416316.issue17044@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, if we would add a regular (instance) method __init_class__ to type, it could (probably) work for regular (non-meta) classes, but not for metaclasses.  If a metaclass Meta wouldn't define __init_class__ itself, calling Meta.__init_class__() in __build_class__ wouldn't work, since Meta would inherit the *instance* method from type (its superclass).  We might be able to make this work somehow (I'm not sure), but I think adding it to object as a classmethod works fine, and doesn't require special casing.

The attached patch documents, that object has an __init_class__ (and also adds some extra tests). I'll attach a patch to the PEP as well.
History
Date User Action Args
2013-02-17 15:45:19daniel.urbansetrecipients: + daniel.urban, ncoghlan, ezio.melotti, flox
2013-02-17 15:45:19daniel.urbansetmessageid: <1361115919.16.0.540491416316.issue17044@psf.upfronthosting.co.za>
2013-02-17 15:45:19daniel.urbanlinkissue17044 messages
2013-02-17 15:45:18daniel.urbancreate