Message182275
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. |
|
Date |
User |
Action |
Args |
2013-02-17 15:45:19 | daniel.urban | set | recipients:
+ daniel.urban, ncoghlan, ezio.melotti, flox |
2013-02-17 15:45:19 | daniel.urban | set | messageid: <1361115919.16.0.540491416316.issue17044@psf.upfronthosting.co.za> |
2013-02-17 15:45:19 | daniel.urban | link | issue17044 messages |
2013-02-17 15:45:18 | daniel.urban | create | |
|