Title: __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.9, Python 3.8, Python 3.7, Python 3.6, Python 3.5
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: retnikt
Priority: normal Keywords:

Created on 2019-10-07 16:06 by retnikt, last changed 2019-10-13 09:01 by retnikt.

Messages (2)
msg354104 - (view) Author: retnikt (retnikt) Date: 2019-10-07 16:06
Essentially the same as (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)
msg354110 - (view) Author: retnikt (retnikt) Date: 2019-10-07 16:29
I can (and will) submit a PR for this, by the way.
Date User Action Args
2019-10-13 09:01:45retniktsettype: behavior
2019-10-07 16:29:26retniktsetmessages: + msg354110
2019-10-07 16:06:40retniktcreate