Show More
@@ -342,7 +342,13 b' class HasTraitlets(object):' | |||||
342 | __metaclass__ = MetaHasTraitlets |
|
342 | __metaclass__ = MetaHasTraitlets | |
343 |
|
343 | |||
344 | def __new__(cls, *args, **kw): |
|
344 | def __new__(cls, *args, **kw): | |
345 | inst = super(HasTraitlets, cls).__new__(cls, *args, **kw) |
|
345 | # This is needed because in Python 2.6 object.__new__ only accepts | |
|
346 | # the cls argument. | |||
|
347 | new_meth = super(HasTraitlets, cls).__new__ | |||
|
348 | if new_meth is object.__new__: | |||
|
349 | inst = new_meth(cls) | |||
|
350 | else: | |||
|
351 | inst = new_meth(cls, *args, **kw) | |||
346 | inst._traitlet_values = {} |
|
352 | inst._traitlet_values = {} | |
347 | inst._traitlet_notifiers = {} |
|
353 | inst._traitlet_notifiers = {} | |
348 | # Here we tell all the TraitletType instances to set their default |
|
354 | # Here we tell all the TraitletType instances to set their default |
General Comments 0
You need to be logged in to leave comments.
Login now