[New-bugs-announce] [issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

retnikt report at bugs.python.org
Mon Oct 7 12:06:40 EDT 2019


New submission from retnikt <retnikt at gmail.com>:

Essentially the same as https://bugs.python.org/issue29581 (more detail is there), but for the additional meta-classes enum.EnumMeta and probably typing.NamedTupleMeta (discussion needed - is there a use-case for this?)

The __new__ method on these metaclasses should include **kwargs at the end of the method definition and pass them on to the super call in order to allow the special method __init_subclass__ to be defined with custom parameters on classes using the metaclass.

(also, perhaps the issue for typing should be reported separately on github python/typing instead)

----------
components: Library (Lib)
messages: 354104
nosy: retnikt
priority: normal
severity: normal
status: open
title: __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38397>
_______________________________________


More information about the New-bugs-announce mailing list