TypeLiteral#
Mypy_boto3_builder Index / Mypy Boto3 Builder / Type Annotations / TypeLiteral
Auto-generated documentation for mypy_boto3_builder.type_annotations.type_literal module.
TypeLiteral#
Show source in type_literal.py:19
Wrapper for typing/typing_extensions.Literal
type annotations like Literal['a', 'b']
.
Arguments#
name
- Literal name for non-inline.children
- Literal values.inline
- Render literal inline.
Signature#
class TypeLiteral(FakeAnnotation):
def __init__(self, name: str, children: Iterable[str]) -> None: ...
See also#
TypeLiteral().copy#
Show source in type_literal.py:78
Create a copy of type annotation wrapper.
Signature#
TypeLiteral()._get_import_records#
Show source in type_literal.py:63
Get import record required for using type annotation.
Signature#
See also#
TypeLiteral().add_child#
Show source in type_literal.py:90
Disabled method to avoid confusion.
Signature#
See also#
TypeLiteral().get_definition_import_records#
Show source in type_literal.py:72
Get import record required for using Literal.
Signature#
See also#
TypeLiteral().get_local_types#
Show source in type_literal.py:102
Get internal types generated by builder.
Signature#
See also#
TypeLiteral().get_sort_key#
Show source in type_literal.py:35
Sort literals by name.
Signature#
TypeLiteral().inline#
Show source in type_literal.py:41
Whether Litereal should be rendered inline.
1-value literals are rendered inline.
Signature#
TypeLiteral().is_literal#
Show source in type_literal.py:84
Whether type annotation is Literal
.
Signature#
TypeLiteral().is_same#
Show source in type_literal.py:96
Check if literals have the same children.
Signature#
TypeLiteral().render#
Show source in type_literal.py:50
Render type annotation to a valid Python code for local usage.
Returns#
A string with a valid type annotation.
Signature#
TypeLiteral().render_definition#
Show source in type_literal.py:108
Render type annotation definition.