TypeTypedDict#
Mypy_boto3_builder Index / Mypy Boto3 Builder / Type Annotations / TypeTypedDict
Auto-generated documentation for mypy_boto3_builder.type_annotations.type_typed_dict module.
TypeTypedDict#
Show source in type_typed_dict.py:71
Wrapper for typing/typing_extensions.TypedDict
type annotations.
Arguments#
name
- Type name.children
- Typed dict attributes.docstring
- Docstring for render.stringify
- Convert type annotation to string to avoid circular deps.
Signature#
class TypeTypedDict(FakeAnnotation, TypeDefSortable):
def __init__(
self,
name: str,
children: Iterable[TypedDictAttribute] = (),
docstring: str = "",
stringify: bool = False,
) -> None: ...
See also#
TypeTypedDict().copy#
Show source in type_typed_dict.py:209
Create a copy of type annotation wrapper.
Signature#
TypeTypedDict()._get_import_records#
Show source in type_typed_dict.py:142
Get import record required for using type annotation.
Signature#
See also#
TypeTypedDict().add_attribute#
Show source in type_typed_dict.py:148
Add new attribute to a dictionary.
Arguments#
name
- Argument name.type_annotation
- Argument type annotation.required
- Whether argument has to be set.
Signature#
See also#
TypeTypedDict().get_children_literals#
Show source in type_typed_dict.py:248
Extract required TypeLiteral list from attributes.
Signature#
See also#
TypeTypedDict().get_children_types#
Show source in type_typed_dict.py:226
Extract required type annotations from attributes.
Signature#
See also#
TypeTypedDict().get_definition_import_records#
Show source in type_typed_dict.py:133
Get import record required for using TypedDict.
Signature#
See also#
TypeTypedDict().get_local_types#
Show source in type_typed_dict.py:270
Get internal types generated by builder.
Signature#
See also#
TypeTypedDict().get_optional#
Show source in type_typed_dict.py:199
Get a list of optional attributes.
Signature#
See also#
TypeTypedDict().get_required#
Show source in type_typed_dict.py:189
Get a list of required attributes.
Signature#
See also#
TypeTypedDict().get_sort_key#
Show source in type_typed_dict.py:106
Sort Typed Dicts by name.
Signature#
TypeTypedDict().get_sortable_children#
Show source in type_typed_dict.py:235
Extract required TypeDefSortable list from attributes.
Signature#
See also#
TypeTypedDict().has_both#
Show source in type_typed_dict.py:183
Whether TypedDict has both optional and required keys.
Signature#
TypeTypedDict().has_optional#
Show source in type_typed_dict.py:171
Whether TypedDict has optional keys.
Signature#
TypeTypedDict().has_required#
Show source in type_typed_dict.py:177
Whether TypedDict has required keys.
Signature#
TypeTypedDict().is_dict#
Show source in type_typed_dict.py:159
Whether type annotation is Dict
or TypedDict
.
Signature#
TypeTypedDict().is_same#
Show source in type_typed_dict.py:220
Check whether typed dict attributes are the same as other
.
Signature#
TypeTypedDict().is_stringified#
Show source in type_typed_dict.py:94
Whether TypedDict usage should be rendered as a string.
Signature#
TypeTypedDict().is_type_def#
Show source in type_typed_dict.py:287
Whether type annotation is a TypeDef.
Signature#
TypeTypedDict().is_typed_dict#
Show source in type_typed_dict.py:165
Whether type annotation is TypedDict
.
Signature#
TypeTypedDict().is_union#
Show source in type_typed_dict.py:293
Whether type annotation is a TypeUnion.
Signature#
TypeTypedDict().iterate_children#
Show source in type_typed_dict.py:263
Iterate over children from required to optional.
Signature#
See also#
TypeTypedDict().render#
Show source in type_typed_dict.py:115
Render type annotation to a valid Python code for local usage.
Returns#
A string with a valid type annotation.
Signature#
TypeTypedDict().render_definition#
Show source in type_typed_dict.py:127
Render type annotation definition.
Signature#
TypeTypedDict().stringify#
Show source in type_typed_dict.py:100
Render TypedDict usage as a string.
Signature#
TypeTypedDict().type_hint_annotations#
Show source in type_typed_dict.py:276
Type annotations list from arguments and return type with internal types.
Signature#
See also#
TypedDictAttribute#
Show source in type_typed_dict.py:22
TypedDict attribute wrapper.
Arguments#
name
- Attribute name.type_annotation
- Attribute type annotation.required
- Whether the attribute has to be set.
Signature#
class TypedDictAttribute:
def __init__(
self, name: str, type_annotation: FakeAnnotation, required: bool
) -> None: ...
See also#
TypedDictAttribute().get_type_annotation#
Show source in type_typed_dict.py:40
Get wrapped for non-required type annotation or raw type annotation.
Signature#
See also#
TypedDictAttribute().is_required#
Show source in type_typed_dict.py:64
Whether argument is required.
Signature#
TypedDictAttribute().iterate_types#
Show source in type_typed_dict.py:58
Itera over type annotations.
Signature#
See also#
TypedDictAttribute().render#
Show source in type_typed_dict.py:49
Render attribute to use in class-based TypedDict definition.
Returns#
A string with argument definition.