bagof.factories.common
Common factories (none, union, literal, typevar, annotated).
Classes
NoneFactory
UnionFactory
Factory for Union hints.
Returns None if the union is optional, otherwise builds a value for
the first member type that can be instantiated.
Example
Methods:
LiteralFactory
TypeVarFactory
AnnotatedFactory
Factory for Annotated hints.
Builds a value using the annotated origin type, unless a more specific factory is provided in the annotation metadata.
Attributes
factories
property
factories: tuple[Factory, ...]
The factories that apply to this annotated hint, ordered from
the origin type (least specific) to the last matching metadata
entry (most specific, used first by __call__).
Methods:
register
classmethod
Register a factory class for one or more pieces of annotation metadata.