Function

mypy-boto3-builder Index / Mypy Boto3 Builder / Structures / Function

Auto-generated documentation for mypy_boto3_builder.structures.function module.

Function

Show source in function.py:14

Module-level function.

Signature

class Function:
    def __init__(
        self,
        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,
    ):
        ...

See also

Function().body

Show source in function.py:74

Function body as a string.

Signature

@property
def body(self) -> str:
    ...

Function().create_request_type_annotation

Show source in function.py:53

Create and set request_type_annotation TypedDict based on function arguments.

Signature

def create_request_type_annotation(self, name: str) -> None:
    ...

Function().get_required_import_records

Show source in function.py:91

Extract required import records.

Signature

def get_required_import_records(self) -> set[ImportRecord]:
    ...

See also

Function().is_kw_only

Show source in function.py:111

Whether method arguments can be passed only as kwargs.

Signature

def is_kw_only(self) -> bool:
    ...

Function().iterate_types

Show source in function.py:81

Iterate over required type annotations.

Signature

def iterate_types(self) -> Iterator[FakeAnnotation]:
    ...

See also

Function().returns_none

Show source in function.py:104

Whether return type is None.

Signature

@property
def returns_none(self) -> bool:
    ...

Function().short_docstring

Show source in function.py:40

Docstring without documentation links.

Signature

@property
def short_docstring(self) -> str:
    ...

Function().type_hint_annotations

Show source in function.py:117

Type annotations list from arguments and return type with internal types.

Signature

@property
def type_hint_annotations(self) -> list[FakeAnnotation]:
    ...

See also