Daniel Urban added the comment:

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.

----------
Added file: http://bugs.python.org/file29101/pep422_5.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17044>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to