Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Functions | Variables
cattrs.cols Namespace Reference

Functions

bool is_any_set (type)
 
bool is_namedtuple (Any type)
 
bool _is_passthrough (type[tuple] type, BaseConverter converter)
 
StructureHook list_structure_factory (type type, BaseConverter converter)
 
UnstructureHook namedtuple_unstructure_factory (type[tuple] cl, BaseConverter converter, Any unstructure_to=None)
 
StructureHook namedtuple_structure_factory (type[tuple] cl, BaseConverter converter)
 
list[Attribute_namedtuple_to_attrs (type[tuple] cl)
 
StructureHook namedtuple_dict_structure_factory (type[tuple] cl, BaseConverter converter, bool|Literal["from_converter"] detailed_validation="from_converter", bool forbid_extra_keys=False, bool use_linecache=True, **AttributeOverride kwargs)
 
UnstructureHook namedtuple_dict_unstructure_factory (type[tuple] cl, BaseConverter converter, bool omit_if_default=False, bool use_linecache=True, **AttributeOverride kwargs)
 

Variables

 T = TypeVar("T")
 

Detailed Description

Utility functions for collections.

Function Documentation

◆ _is_passthrough()

bool cattrs.cols._is_passthrough ( type[tuple]  type,
BaseConverter  converter 
)
protected
If all fields would be passed through, this class should not be processed
either.

◆ _namedtuple_to_attrs()

list[Attribute] cattrs.cols._namedtuple_to_attrs ( type[tuple]  cl)
protected
Generate pseudo attributes for a namedtuple.

◆ is_any_set()

bool cattrs.cols.is_any_set (   type)
A predicate function for both mutable and frozensets.

◆ is_namedtuple()

bool cattrs.cols.is_namedtuple ( Any  type)
A predicate function for named tuples.

◆ list_structure_factory()

StructureHook cattrs.cols.list_structure_factory ( type  type,
BaseConverter  converter 
)
A hook factory for structuring lists.

Converts any given iterable into a list.

◆ namedtuple_dict_structure_factory()

StructureHook cattrs.cols.namedtuple_dict_structure_factory ( type[tuple]  cl,
BaseConverter  converter,
bool | Literal["from_converter"]   detailed_validation = "from_converter",
bool   forbid_extra_keys = False,
bool   use_linecache = True,
**AttributeOverride  kwargs 
)
A hook factory for hooks structuring namedtuples from dictionaries.

:param forbid_extra_keys: Whether the hook should raise a `ForbiddenExtraKeysError`
    if unknown keys are encountered.
:param use_linecache: Whether to store the source code in the Python linecache.

.. versionadded:: 24.1.0

◆ namedtuple_dict_unstructure_factory()

UnstructureHook cattrs.cols.namedtuple_dict_unstructure_factory ( type[tuple]  cl,
BaseConverter  converter,
bool   omit_if_default = False,
bool   use_linecache = True,
**AttributeOverride  kwargs 
)
A hook factory for hooks unstructuring namedtuples to dictionaries.

:param omit_if_default: When true, attributes equal to their default values
    will be omitted in the result dictionary.
:param use_linecache: Whether to store the source code in the Python linecache.

.. versionadded:: 24.1.0

◆ namedtuple_structure_factory()

StructureHook cattrs.cols.namedtuple_structure_factory ( type[tuple]  cl,
BaseConverter   converter 
)
A hook factory for structuring namedtuples from iterables.

◆ namedtuple_unstructure_factory()

UnstructureHook cattrs.cols.namedtuple_unstructure_factory ( type[tuple]  cl,
BaseConverter  converter,
Any   unstructure_to = None 
)
A hook factory for unstructuring namedtuples.

:param unstructure_to: Force unstructuring to this type, if provided.