bundles / numpy 2.4.3 / numpy / lib / _npyio_impl / BagObj
class
numpy.lib._npyio_impl:BagObj
source: /numpy/lib/_npyio_impl.py :50
Signature
class BagObj ( obj ) Members
Summary
Convert attribute look-ups to getitems on the object passed in.
Parameters
obj: class instanceObject on which attribute look-up is performed.
Examples
import numpy as np from numpy.lib._npyio_impl 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 bagobj.I_can_be_anything✓
Aliases
-
numpy.lib._npyio_impl.BagObj