[issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta)

Nick Coghlan report at bugs.python.org
Thu Feb 23 10:38:23 EST 2017


Nick Coghlan added the comment:

Note that the publisher side workaround for this is relatively straightforward: __init_subclass__ implementations that want to be compatible with arbitrary metaclasses will need to take any additional parameters as class attributes (which they may delete), rather than as class header keyword arguments.

For 3.7 though, it probably makes sense to update abc.ABCMeta to pass along arbitrary keyword arguments based on the same rationale as used in PEP 487 to justify making this change for type itself: by default, type.__init_subclass__ will still complain about it, but if someone overrides __init_subclass__ to accept additional keyword arguments, doing so will just work.

----------
versions: +Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29581>
_______________________________________


More information about the Python-bugs-list mailing list