Skip to content

Commit

Permalink
Pass **kwds in MetaHasDescriptors __new__ and __init__ (#881)
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Fleming <Alan.Fleming@utas.edu.au>
  • Loading branch information
fleming79 and Alan Fleming committed Oct 21, 2023
1 parent a80f16a commit 936525b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions traitlets/traitlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ class MetaHasDescriptors(type):
instantiated and sets their name attribute.
"""

def __new__(mcls, name, bases, classdict): # noqa
def __new__(mcls, name, bases, classdict, **kwds): # noqa
"""Create the HasDescriptors class."""
for k, v in classdict.items():
# ----------------------------------------------------------------
Expand All @@ -981,11 +981,11 @@ def __new__(mcls, name, bases, classdict): # noqa
classdict[k] = v()
# ----------------------------------------------------------------

return super().__new__(mcls, name, bases, classdict)
return super().__new__(mcls, name, bases, classdict, **kwds)

def __init__(cls, name: str, bases: t.Any, classdict: t.Any) -> None:
def __init__(cls, name: str, bases: t.Any, classdict: t.Any, **kwds) -> None:
"""Finish initializing the HasDescriptors class."""
super().__init__(name, bases, classdict)
super().__init__(name, bases, classdict, **kwds)
cls.setup_class(classdict)

def setup_class(cls, classdict):
Expand Down

0 comments on commit 936525b

Please sign in to comment.