module documentation

Data interfaces for var objects

This module implements two primary means of data interface:

  • The Converter system, which uses the descriptor protocol to treat var data sections as their canonical types.

    Each data section of a var, while stored as raw bytes, can be interpreted as some other useful type. Each Converter class implements a conversion to such a type, such as bytes <-> str using latin-1. A data section is declared as either a base Section or a View into another section and assigned a converter. The system allows a user to access data sections as regular variables without cumbersome getters or setters.

    See the Converter class and its children, and the Section and View classes for implementation details.

  • The Loader system, which implements convenient object initialization using existing mutation methods.

    A Dock instance can declare Loader methods which accept some sets of input types, such as load_string. Each loader is called by a generic load method should the input type be permissible for that loader. Var types call the generic loader during initialization should an initializer be passed.

    See the Dock and Loader classes for implementation details.

Class Bits Sliceable converter to extract and package a slice of bits within a byte
Class Boolean Converter for data sections best interpreted as boolean flags
Class Bytes No-op converter for data sections best interpreted as raw bytes
Class Converter Abstract base class for data section converters
Class Data No-op converter for data sections with associated metadata
Class Dock Base class to inherit to implement the loader system
Class Integer Converter for data sections best interpreted as integers
Class Loader Function decorator to identify methods as data loaders for Dock instances
Class Section Data section class which handles conversion between bytes and appropriate data types
Class SizedData No-op converter for sized data sections with associated metadata
Class String Converter for data sections best interpreted as strings
Class View Data view class which handles conversion between portions of data sections and appropriate data types
Type Variable _T Undocumented

Undocumented

Value
TypeVar('_T')