diff --git a/IPython/utils/tests/test_traitlets.py b/IPython/utils/tests/test_traitlets.py index cc3510d..868aa46 100644 --- a/IPython/utils/tests/test_traitlets.py +++ b/IPython/utils/tests/test_traitlets.py @@ -367,29 +367,29 @@ class TestHasTraitsNotify(TestCase): class A(HasTraits): listen_to = ['a'] - + a = Int(0) b = 0 - + def __init__(self, **kwargs): super(A, self).__init__(**kwargs) self.on_trait_change(self.listener1, ['a']) - + def listener1(self, name, old, new): self.b += 1 class B(A): - + c = 0 d = 0 - + def __init__(self, **kwargs): super(B, self).__init__(**kwargs) self.on_trait_change(self.listener2) - + def listener2(self, name, old, new): self.c += 1 - + def _a_changed(self, name, old, new): self.d += 1 @@ -455,7 +455,7 @@ class TestHasTraits(TestCase): def __init__(self, i): super(A, self).__init__() self.i = i - + a = A(5) self.assertEqual(a.i, 5) # should raise TypeError if no positional arg given @@ -888,7 +888,7 @@ class TestList(TraitTestBase): _default_value = [] _good_values = [[], [1], list(range(10)), (1,2)] _bad_values = [10, [1,'a'], 'a'] - + def coerce(self, value): if value is not None: value = list(value) @@ -1086,7 +1086,7 @@ class TestLink(TestCase): count = Int() a = A(value=9) b = B(count=8) - + # Register callbacks that count. callback_count = [] def a_callback(name, old, new): diff --git a/IPython/utils/traitlets.py b/IPython/utils/traitlets.py index 30629a8..3659d21 100644 --- a/IPython/utils/traitlets.py +++ b/IPython/utils/traitlets.py @@ -232,7 +232,7 @@ class link(object): for obj,attr in self.objects.keys(): if obj is not sending_obj or attr != sending_attr: setattr(obj, attr, new) - + def unlink(self): for key, callback in self.objects.items(): (obj,attr) = key @@ -1374,7 +1374,7 @@ class List(Container): self.length_error(obj, value) return super(List, self).validate_elements(obj, value) - + def validate(self, obj, value): value = super(List, self).validate(obj, value) if value is None: @@ -1383,7 +1383,7 @@ class List(Container): value = self.validate_elements(obj, value) return value - + class Set(List):