Skip to content


Index > MemoryDB > Examples

Auto-generated documentation for MemoryDB type annotations stubs module mypy-boto3-memorydb.


Implicit type annotations

Can be used with boto3-stubs[memorydb] package installed.

Write your MemoryDB code as usual, type checking and code completion should work out of the box.

Client usage example
from boto3.session import Session

session = Session()

client = session.client("memorydb")  # (1)
result = client.batch_update_cluster()  # (2)
  1. client: MemoryDBClient
  2. result: BatchUpdateClusterResponseTypeDef

Explicit type annotations

With boto3-stubs-lite[memorydb] or a standalone mypy_boto3_memorydb package, you have to explicitly specify client: MemoryDBClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

Client usage example
from boto3.session import Session

from mypy_boto3_memorydb.client import MemoryDBClient
from mypy_boto3_memorydb.type_defs import BatchUpdateClusterResponseTypeDef
from mypy_boto3_memorydb.type_defs import BatchUpdateClusterRequestRequestTypeDef

session = Session()

client: MemoryDBClient = session.client("memorydb")

kwargs: BatchUpdateClusterRequestRequestTypeDef = {...}
result: BatchUpdateClusterResponseTypeDef = client.batch_update_cluster(**kwargs)