class BagObj:
BagObj(obj)
Convert attribute look-ups to getitems on the object passed in.
>>> from numpy.lib.npyio import BagObj as BO >>> class BagDemo: ... def __getitem__(self, key): # An instance of BagObj(BagDemo) ... # will call this method when any ... # attribute look-up is required ... result = "Doesn't matter what you want, " ... return result + "you're gonna get this" ... >>> demo_obj = BagDemo() >>> bagobj = BO(demo_obj) >>> bagobj.hello_there "Doesn't matter what you want, you're gonna get this" >>> bagobj.I_can_be_anything "Doesn't matter what you want, you're gonna get this"
Method | __dir__ |
Enables dir(bagobj) to list the files in an NpzFile. |
Method | __getattribute__ |
Undocumented |
Method | __init__ |
Undocumented |
Instance Variable | _obj |
Undocumented |