TypeUnion#
Mypy_boto3_builder Index / Mypy Boto3 Builder / Type Annotations / TypeUnion
Auto-generated documentation for mypy_boto3_builder.type_annotations.type_union module.
TypeUnion#
Show source in type_union.py:21
Wrapper for name Union type annotations, like MyUnion = Union[str, int]
.
Signature#
class TypeUnion(TypeSubscript, TypeDefSortable):
def __init__(
self, children: Iterable[FakeAnnotation], name: str = "", stringify: bool = False
) -> None: ...
See also#
TypeUnion().copy#
Show source in type_union.py:74
Create a copy of type annotation wrapper.
Signature#
TypeUnion()._get_import_records#
Show source in type_union.py:131
Get import record required for using type annotation.
Signature#
See also#
TypeUnion().get_children_literals#
Show source in type_union.py:106
Extract required TypeLiteral list from attributes.
Signature#
See also#
TypeUnion().get_children_types#
Show source in type_union.py:84
Extract required type annotations from attributes.
Signature#
See also#
TypeUnion().get_definition_import_records#
Show source in type_union.py:121
Get import record required for using Union.
Signature#
See also#
TypeUnion().get_import_records#
Show source in type_union.py:137
Get all import records required for using type annotation.
Signature#
See also#
TypeUnion().get_sortable_children#
Show source in type_union.py:93
Extract required TypeDefSortable list from attributes.
Signature#
See also#
TypeUnion().is_named#
Show source in type_union.py:68
Check if type annotation is a named type annotation.
Signature#
TypeUnion().is_stringified#
Show source in type_union.py:39
Whether Union usage should be rendered as a string.
Signature#
TypeUnion().is_type_def#
Show source in type_union.py:153
Whether type annotation is a TypeDef.
Signature#
TypeUnion().is_union#
Show source in type_union.py:170
Whether type annotation is a TypeUnion.
Signature#
TypeUnion().iterate_children#
Show source in type_union.py:176
Iterate over children.
Signature#
See also#
TypeUnion().iterate_types#
Show source in type_union.py:143
Extract type annotations from children.
Signature#
See also#
TypeUnion().render#
Show source in type_union.py:51
Render type annotation to a valid Python code for local usage.
Returns#
A string with a valid type annotation.
Signature#
TypeUnion().render_definition#
Show source in type_union.py:182
Render type annotation definition.
Signature#
TypeUnion().stringify#
Show source in type_union.py:45
Render Union usage as a string.
Signature#
TypeUnion().type_hint_annotations#
Show source in type_union.py:159
Type annotations list from arguments and return type with internal types.