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:22
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:75
Create a copy of type annotation wrapper.
Signature#
TypeUnion().get_children_literals#
Show source in type_union.py:107
Extract required TypeLiteral list from attributes.
Signature#
See also#
TypeUnion().get_children_types#
Show source in type_union.py:85
Extract required type annotations from attributes.
Signature#
See also#
TypeUnion().get_definition_import_records#
Show source in type_union.py:122
Get import record required for using Union.
Signature#
See also#
TypeUnion().get_import_records#
Show source in type_union.py:138
Get all import records required for using type annotation.
Signature#
See also#
TypeUnion().get_sortable_children#
Show source in type_union.py:94
Extract required TypeDefSortable list from attributes.
Signature#
See also#
TypeUnion().is_named#
Show source in type_union.py:69
Check if type annotation is a named type annotation.
Signature#
TypeUnion().is_stringified#
Show source in type_union.py:40
Whether Union usage should be rendered as a string.
Signature#
TypeUnion().is_type_def#
Show source in type_union.py:154
Whether type annotation is a TypeDef.
Signature#
TypeUnion().is_union#
Show source in type_union.py:171
Whether type annotation is a TypeUnion.
Signature#
TypeUnion().iterate_children#
Show source in type_union.py:177
Iterate over children.
Signature#
See also#
TypeUnion().iterate_types#
Show source in type_union.py:144
Extract type annotations from children.
Signature#
See also#
TypeUnion().render#
Show source in type_union.py:52
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:183
Render type annotation definition.
Signature#
TypeUnion().stringify#
Show source in type_union.py:46
Render Union usage as a string.
Signature#
TypeUnion().type_hint_annotations#
Show source in type_union.py:160
Type annotations list from arguments and return type with internal types.