Skip to content

Commit

Permalink
Add **kwds to MetaHasDescriptors.__new__ & MetaHasDescriptors__init__
Browse files Browse the repository at this point in the history
  • Loading branch information
fleming79 committed Oct 14, 2023
1 parent 31aaa1a commit 4d2da28
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 4d2da28

Please sign in to comment.