bundles / IPython 9.17.0 / IPython / utils / ipstruct / Struct / __setitem__
function
IPython.utils.ipstruct:Struct.__setitem__
Signature
def __setitem__(self, key: str, value: Any)Summary
Set an item with check for allownew.
Examples
s = Struct() s['a'] = 10 s.allow_new_attr(False) s['a'] = 10 s['a'] try: s['b'] = 20 except KeyError: print('this is not allowed')✓
this is not allowed
Aliases
IPython.core.interactiveshell.Struct.__setitem__