Function
Auto-generated documentation for mypy_boto3_builder.structures.function module.
Module-level function.
- mypy-boto3-builder / Modules / Mypy Boto3 Builder / Structures / Function
Function
class Function():
def __init__(
name: str,
arguments: Iterable[Argument],
return_type: FakeAnnotation,
docstring: str = '',
decorators: Iterable[FakeAnnotation] = tuple(),
body_lines: Iterable[str] = tuple(),
type_ignore: bool = False,
is_async: bool = False,
):
Module-level function.
See also
Function().body
@property
def body() -> str:
Function body as a string.
Function().create_request_type_annotation
def create_request_type_annotation(name: str) -> None:
Create and set request_type_annotation
TypedDict based on function arguments.
Function().get_required_import_records
def get_required_import_records() -> set[ImportRecord]:
Extract required import records.
See also
Function().is_kw_only
def is_kw_only() -> bool:
Whether method arguments can be passed only as kwargs.
Function().iterate_types
def iterate_types() -> Iterator[FakeAnnotation]:
Iterate over required type annotations.
See also
Function().returns_none
@property
def returns_none() -> bool:
Whether return type is None.
Function().short_docstring
@property
def short_docstring() -> str:
Docstring without documentation links.
Function().type_hint_annotations
@property
def type_hint_annotations() -> list[FakeAnnotation]:
Type annotations list from arguments and return type with internal types.