Skip to content

Commit

Permalink
Merge pull request #173 from rmorshea/pass_args_in_new
Browse files Browse the repository at this point in the history
pass *args to __new__
  • Loading branch information
minrk committed Feb 17, 2016
2 parents c36d314 + 90dac53 commit 1d31bd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions traitlets/traitlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,14 +898,14 @@ class HasDescriptors(py3compat.with_metaclass(MetaHasDescriptors, object)):
"""The base class for all classes that have descriptors.
"""

def __new__(cls, *args, **kw):
def __new__(cls, *args, **kwargs):
# This is needed because object.__new__ only accepts
# the cls argument.
new_meth = super(HasDescriptors, cls).__new__
if new_meth is object.__new__:
inst = new_meth(cls)
else:
inst = new_meth(cls, **kw)
inst = new_meth(cls, *args, **kwargs)
inst.setup_instance()
return inst

Expand Down

0 comments on commit 1d31bd7

Please sign in to comment.