astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- Astropy Core Package Utilities (`astropy.utils`) »
- DataInfo

# DataInfo

class astropy.utils.data_info.DataInfo(bound=False)

  Bases: `object`

  Descriptor that data classes use to add an `info` attribute for storing data attributes in a uniform and portable way. Note that it must be called `info` so that the DataInfo() object can be stored in the `instance` using the `info` key. Because owner_cls.x is a descriptor, Python doesn’t use __dict__[‘x’] normally, and the descriptor can safely store stuff there. Thanks to https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb for this trick that works for non-hashable classes.

  Parameters:
    bound bool

      If True this is a descriptor attribute in a class definition, else it is a DataInfo() object that is bound to a data object instance. Default is False.