This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / lib / _npyio_impl / BagObj

class

numpy.lib._npyio_impl:BagObj

source: build-install/usr/lib/python3.14/site-packages/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 instance

Object 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