InternalImport

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

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

AliasInternalImport

Show source in internal_import.py:84

Internal import for safe local usages.

Arguments

  • name - Import name.
  • service_name - Service that import belongs to.

Signature

class AliasInternalImport(InternalImport):
    def __init__(self, name: str, service_name: ServiceName | None = None) -> None:
        ...

See also

InternalImport

Show source in internal_import.py:10

Wrapper for simple type annotations from this module.

Arguments

  • name - Import name.
  • service_name - Service that import belongs to.
  • module_name - Service module name.
  • stringify - Convert type annotation to string to avoid circular deps.
  • use_alias - Use name alias.

Signature

class InternalImport(FakeAnnotation):
    def __init__(
        self,
        name: str,
        service_name: ServiceName | None = None,
        module_name: ServiceModuleName = ServiceModuleName.service_resource,
        stringify: bool = True,
        use_alias: bool = False,
    ) -> None:
        ...

See also

InternalImport().copy

Show source in internal_import.py:71

Create a copy of type annotation wrapper.

Signature

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

InternalImport.get_alias

Show source in internal_import.py:36

Get import name alias.

Arguments

  • name - Original name.

Returns

Name prefixed with underscore.

Signature

@staticmethod
def get_alias(name: str) -> str:
    ...

InternalImport().get_import_record

Show source in internal_import.py:65

Get import record required for using type annotation.

Signature

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

See also

InternalImport().render

Show source in internal_import.py:49

Render type annotation to a valid Python code for local usage.

Returns

A string with a valid type annotation.

Signature

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