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 should support a strict keys mode #921
Please add support for a way to restrict keys on a Dict...
Example of what should raise a TraitError
fromtraitletsimportHasTraits, Dict, UnicodeclassFoo(HasTraits):
# the strict_keys keyword is a suggested feature...data=Dict(per_key_traits={"this_key": Unicode()}, strict_keys=True)
foo=Foo()
# This is fine...foo.data= {"this_key": "value"}
# This should raise a TraitErrorfoo.data= {"invalid_key": None}
changed the title [-]traitlets Dict with per_key_traits should support a strict keys mode[/-][+]traitlets Dict should support a strict keys mode[/+]on May 11, 2025
Activity
[-]traitlets Dict with per_key_traits should support a strict keys mode[/-][+]traitlets Dict should support a strict keys mode[/+]