From 5f8d0fd9bcbb9b7ff7d4c1190bb7e60bb759fb55 2013-04-21 21:51:49 From: MinRK Date: 2013-04-21 21:51:49 Subject: [PATCH] add ignored *args to HasTraits constructor makes subclassing nicer / easier discussed [on the list](http://mail.scipy.org/pipermail/ipython-dev/2013-April/011409.html). --- diff --git a/IPython/utils/traitlets.py b/IPython/utils/traitlets.py index 21764e7..6c85e04 100644 --- a/IPython/utils/traitlets.py +++ b/IPython/utils/traitlets.py @@ -398,7 +398,7 @@ class HasTraits(object): __metaclass__ = MetaHasTraits - def __new__(cls, **kw): + def __new__(cls, *args, **kw): # This is needed because in Python 2.6 object.__new__ only accepts # the cls argument. new_meth = super(HasTraits, cls).__new__ @@ -425,7 +425,7 @@ class HasTraits(object): return inst - def __init__(self, **kw): + def __init__(self, *args, **kw): # Allow trait values to be set using keyword arguments. # We need to use setattr for this to trigger validation and # notifications.