UnifiedReadWriteMethod

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

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
funcUnifiedReadWrite subclass

Class that defines read or write functionality