You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The behavior of the copy function is not the ideal one (already reported), but copying it by hand doesn't work either.
classFoo(HasTraits):
bar=Dict()
@observe('bar')def_observe_bar(self, change):
print(change['new'])
foo=Foo()
foo.bar= {} # prints {}foo.bar['foo'] ='foo'# does not observe that changefoo.bar=copy(foo.bar) # both changes are not observed either.foo.bar=deepcopy(foo.bar)
foo.bar= {'foo': 'foo'} # not observed !foo.bar= {'foo':'bar'} # observedfoo.bar= {'bar':'bar'} # observed
outputs :
{}
{'foo': 'bar'}
{'bar': 'bar'}
Is it a normal behavior ?
The text was updated successfully, but these errors were encountered:
The behavior of the copy function is not the ideal one (already reported), but copying it by hand doesn't work either.
outputs :
Is it a normal behavior ?
The text was updated successfully, but these errors were encountered: