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
{{ message }}
Repository navigation
traitlets Dict does not observe value changes after initial key / value assigments #922
I'm using traitlets version 5.14.3 and Python 3.12.3...
In both cases below, a TraitError is not thrown, even though None is assigned to a Unicode() field after initialization...
fromtraitletsimportHasTraits, Dict, UnicodeclassFoo(HasTraits):
data=Dict(per_key_traits={"a_key": Unicode()})
classBar(HasTraits):
data=Dict(key_trait=Unicode(), value_trait=Unicode())
foo=Foo()
foo.data= {"a_key": "a_value"}
# I think this should throw a TraitError...foo.data["a_key"] =Nonebar=Bar()
bar.data= {"a_key": "a_value"}
# I think this should throw a TraitError...bar.data["a_key"] =None
Activity
rmorshea commentedon May 13, 2025
Duplicate of #557
rmorshea commentedon May 13, 2025
I suggest taking a look at Spectate