How do I update the dictionary of a mapped trait, after I've already constructed it?
问题 I need to update the dictionary of a mapped trait some time after initial trait creation. How do I do this? The following code: from traits.api import (HasTraits, Trait) class bar(HasTraits): zap = Trait("None", {"None": None}) def __init__(self): # In reality, determined programmatically at runtime. add_dict_entries = {"One": 1} new_dict = {"None": None} new_dict.update(add_dict_entries) self.zap = Trait("None", new_dict) theBar = bar() yields: Traceback (most recent call last): File "tst