bundles / IPython 9.3.0 / IPython / utils / ipstruct / Struct / __getattr__
function
IPython.utils.ipstruct:Struct.__getattr__
source: /IPython/utils/ipstruct.py :122
Signature
def __getattr__ ( self , key ) Summary
Get an attr by calling dict.__getitem__.
Extended Summary
Like __setattr__, this method converts KeyError to AttributeError.
Examples
s = Struct(a=10) s.a type(s.get) try: s.b except AttributeError: print("I don't have that key")✓
Aliases
-
IPython.core.interactiveshell.Struct.__getattr__