InternalImport

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

Wrapper for simple type annotations from this module.

AliasInternalImport

[find in source code]

class AliasInternalImport(InternalImport):
    def __init__(
        name: str,
        service_name: Optional[ServiceName] = None,
    ) -> None:

Internal import for safe local usages.

Arguments

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

See also

InternalImport

[find in source code]

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

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.

See also

InternalImport().copy

[find in source code]

def copy() -> 'InternalImport':

Create a copy of type annotation wrapper.

InternalImport.get_alias

[find in source code]

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

Get import name alias.

Arguments

  • name - Original name.

Returns

Name prefixed with underscore.

InternalImport().get_import_record

[find in source code]

def get_import_record() -> ImportRecord:

Get import record required for using type annotation.

See also

InternalImport().render

[find in source code]

def render(parent_name: str = '') -> str:

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

Returns

A string with a valid type annotation.