astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- I/O Registry (`astropy.io.registry`) »
- UnifiedReadWriteMethod

# UnifiedReadWriteMethod

class astropy.io.registry.UnifiedReadWriteMethod(fget=None, fset=None, fdel=None, doc=None)

  Bases: `property`

  Descriptor class for creating read() and write() methods in unified I/O.

  The canonical example is in the `Table` class, where the `connect.py` module creates subclasses of the `UnifiedReadWrite` class. These have custom `__call__` methods that do the setup work related to calling the registry read() or write() functions. With this, the `Table` class defines read and write methods as follows:

      read = UnifiedReadWriteMethod(TableRead)
      write = UnifiedReadWriteMethod(TableWrite)

  Parameters:
    func `UnifiedReadWrite` subclass

      Class that defines read or write functionality