[issue17044] Implement PEP 422: Simple class initialisation hook
Daniel Urban
report at bugs.python.org
Sun Apr 14 15:59:41 CEST 2013
Daniel Urban added the comment:
I've attached a new patch. With this patch, type.__prepare__ has an optional keyword-only argument 'namespace', and returns it if it's specified. Also, __init_class__ is passed an argument: a mapping proxy of the mapping originally returned by __prepare__.
> Would it make sense to have the signature of __init_class__ parallel
> meta.__init__()
I don't think so, because some of the arguments (name, bases) would be mostly useless, others would have a different meaning (namespace). Although, passing the keyword arguments from the class header might make some sense ... I'm not sure.
If everybody agrees with these changes, I'll create a patch for the PEP too.
----------
Added file: http://bugs.python.org/file29851/pep422_6.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17044>
_______________________________________
More information about the Python-bugs-list
mailing list