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:79
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:220
Create a copy of type annotation wrapper.
Signature#
TypeTypedDict().hash#
Show source in type_typed_dict.py:120
Calculate hash value based on name and children.
Signature#
TypeTypedDict()._get_import_records#
Show source in type_typed_dict.py:153
Get import record required for using type annotation.
Signature#
See also#
TypeTypedDict().add_attribute#
Show source in type_typed_dict.py:159
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:259
Extract required TypeLiteral list from attributes.
Signature#
See also#
TypeTypedDict().get_children_types#
Show source in type_typed_dict.py:237
Extract required type annotations from attributes.
Signature#
See also#
TypeTypedDict().get_definition_import_records#
Show source in type_typed_dict.py:144
Get import record required for using TypedDict.
Signature#
See also#
TypeTypedDict().get_local_types#
Show source in type_typed_dict.py:281
Get internal types generated by builder.
Signature#
See also#
TypeTypedDict().get_optional#
Show source in type_typed_dict.py:210
Get a list of optional attributes.
Signature#
See also#
TypeTypedDict().get_required#
Show source in type_typed_dict.py:200
Get a list of required attributes.
Signature#
See also#
TypeTypedDict().get_sort_key#
Show source in type_typed_dict.py:114
Sort Typed Dicts by name.
Signature#
TypeTypedDict().get_sortable_children#
Show source in type_typed_dict.py:246
Extract required TypeDefSortable list from attributes.
Signature#
See also#
TypeTypedDict().has_both#
Show source in type_typed_dict.py:194
Whether TypedDict has both optional and required keys.
Signature#
TypeTypedDict().has_optional#
Show source in type_typed_dict.py:182
Whether TypedDict has optional keys.
Signature#
TypeTypedDict().has_required#
Show source in type_typed_dict.py:188
Whether TypedDict has required keys.
Signature#
TypeTypedDict().is_dict#
Show source in type_typed_dict.py:170
Whether type annotation is Dict
or TypedDict
.
Signature#
TypeTypedDict().is_same#
Show source in type_typed_dict.py:231
Check whether typed dict attributes are the same as other
.
Signature#
TypeTypedDict().is_stringified#
Show source in type_typed_dict.py:102
Whether TypedDict usage should be rendered as a string.
Signature#
TypeTypedDict().is_type_def#
Show source in type_typed_dict.py:298
Whether type annotation is a TypeDef.
Signature#
TypeTypedDict().is_typed_dict#
Show source in type_typed_dict.py:176
Whether type annotation is TypedDict
.
Signature#
TypeTypedDict().is_union#
Show source in type_typed_dict.py:304
Whether type annotation is a TypeUnion.
Signature#
TypeTypedDict().iterate_children#
Show source in type_typed_dict.py:274
Iterate over children from required to optional.
Signature#
See also#
TypeTypedDict().render#
Show source in type_typed_dict.py:126
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:138
Render type annotation definition.
Signature#
TypeTypedDict().stringify#
Show source in type_typed_dict.py:108
Render TypedDict usage as a string.
Signature#
TypeTypedDict().type_hint_annotations#
Show source in type_typed_dict.py:287
Type annotations list from arguments and return type with internal types.
Signature#
See also#
TypedDictAttribute#
Show source in type_typed_dict.py:21
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().hash#
Show source in type_typed_dict.py:36
Calculate hash value based on name, required and type annotation.
Signature#
TypedDictAttribute().get_type_annotation#
Show source in type_typed_dict.py:42
Get wrapped for non-required type annotation or raw type annotation.
Signature#
See also#
TypedDictAttribute().is_required#
Show source in type_typed_dict.py:66
Whether argument is required.
Signature#
TypedDictAttribute().iterate_types#
Show source in type_typed_dict.py:60
Itera over type annotations.
Signature#
See also#
TypedDictAttribute().mark_as_required#
Show source in type_typed_dict.py:72
Mark attribute as required.
Signature#
TypedDictAttribute().render#
Show source in type_typed_dict.py:51
Render attribute to use in class-based TypedDict definition.
Returns#
A string with argument definition.