ExternalImport

mypy-boto3-builder Index / Mypy Boto3 Builder / Type Annotations / ExternalImport

Auto-generated documentation for mypy_boto3_builder.type_annotations.external_import module.

ExternalImport

Show source in external_import.py:9

Wrapper for type annotations imported from 3rd party libraries, like boto3.service.Service.

Arguments

  • source - Module import string.
  • name - Import name.
  • alias - Import local name.
  • safe - Whether import is wrapped in try-except.

Signature

class ExternalImport(FakeAnnotation):
    def __init__(
        self, source: ImportString, name: str = "", alias: str = "", safe: bool = False
    ) -> None:
        ...

See also

ExternalImport().copy

Show source in external_import.py:65

Create a copy of type annotation wrapper.

Signature

def copy(self) -> "ExternalImport":
    ...

ExternalImport().get_import_record

Show source in external_import.py:59

Get import record required for using type annotation.

Signature

def get_import_record(self) -> ImportRecord:
    ...

See also

ExternalImport().import_record

Show source in external_import.py:32

Get import record required for using type annotation.

Signature

@property
def import_record(self) -> ImportRecord:
    ...

See also

ExternalImport().render

Show source in external_import.py:50

Get string with local name to use.

Returns

Import record local name.

Signature

def render(self, parent_name: str = "") -> str:
    ...