This module provides a container that combines aspects of
object. It is implemented as a class factory, in a similar way to
and has the following features:
- The constructor can take defaults and type annotations; if type annotations are present they are checked by default.
- The constructor can used like a
tuple, or with named arguments like
- The generated class subclasses
dictand so has the usual
dictiteration / read methods.
- Contents can be accessed via
and also via attributes (it unifies the
- Optionally, instances can be read–only (immutable), in which case they are also hashable.
- Instances are fixed in size, containing only the entries specified in the
constructor, unless an additional
__argument is given (which can optionally specify a type for extra values).