bundles / IPython 9.11.0 / IPython / utils / ipstruct / Struct / __setitem__
function
IPython.utils.ipstruct:Struct.__setitem__
source: /IPython/utils/ipstruct.py :65
Signature
def __setitem__ ( self , key , value ) 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__