{"id":3074,"library":"mypy-boto3-dlm","title":"Type Annotations for Boto3 DLM Service","description":"mypy-boto3-dlm (version 1.42.84) provides static type annotations for the AWS Data Lifecycle Manager (DLM) service within the `boto3` library. It enables static analysis tools like MyPy and Pyright, and IDEs such as VSCode and PyCharm, to offer robust autocomplete, early error detection, and improved code quality for your `boto3` interactions. This package is automatically generated and kept in sync with `boto3` updates by the `mypy-boto3` project.","status":"active","version":"1.42.84","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","type-hints","stubs","dlm"],"install":[{"cmd":"pip install mypy-boto3-dlm boto3","lang":"bash","label":"Install `mypy-boto3-dlm` and `boto3`"}],"dependencies":[{"reason":"Provides the actual AWS SDK functionality that these stubs annotate.","package":"boto3"}],"imports":[{"note":"The client class is directly importable from the top-level package for convenience.","wrong":"from mypy_boto3_dlm.client import DLMClient","symbol":"DLMClient","correct":"from mypy_boto3_dlm import DLMClient"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_dlm import DLMClient\n\n# Instantiate the boto3 client with type hints\nclient: DLMClient = boto3.client(\"dlm\", region_name=\"us-east-1\")\n\n# Example usage with type-checked methods and arguments\ntry:\n    response = client.get_lifecycle_policies(\n        PolicyIds=[\"policy-0123456789abcdef0\"]\n    )\n    print(\"Successfully retrieved DLM policies:\", response[\"Policies\"])\nexcept client.exceptions.ResourceNotFoundException as e:\n    print(f\"Policy not found: {e}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This example demonstrates how to import and use the `DLMClient` type for static analysis. The `if TYPE_CHECKING:` block ensures that the import is only active during type checking, avoiding potential runtime overhead or issues if stubs are not present in the production environment. Replace `policy-0123456789abcdef0` with an actual DLM policy ID for a successful response."},"warnings":[{"fix":"Upgrade your project's Python version to 3.9 or higher.","message":"Starting with `mypy-boto3-builder` version 8.12.0 (which generates `mypy-boto3-dlm` versions like 1.42.84), support for Python 3.8 has been removed across all `mypy-boto3` packages. Projects must use Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review your code for direct references to TypeDef names and update them according to the new naming conventions (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). Refer to the `mypy-boto3-builder` release notes for details.","message":"Type definition (TypeDef) naming conventions underwent breaking changes in `mypy-boto3-builder` version 8.9.0. If you were directly referencing generated TypeDefs by their full names (e.g., in custom code generation or by relying on old names), your code might break.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Ensure both `boto3` and `mypy-boto3-dlm` are installed: `pip install boto3 mypy-boto3-dlm`.","message":"The `mypy-boto3-dlm` package provides only type annotations. You must also install the `boto3` library itself for your code to function at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider using `boto3-stubs-lite` (if available for DLM) which offers a more RAM-friendly version with fewer overloads, or disable PyCharm's internal type checker and rely on `mypy` or `pyright`.","message":"Users of PyCharm might experience slow performance or high CPU usage due to PyCharm's handling of `Literal` overloads in `mypy-boto3` packages. This is a known PyCharm issue (PY-40997).","severity":"gotcha","affected_versions":"All versions with PyCharm < 2023.3"},{"fix":"Use a pattern like `if TYPE_CHECKING: from mypy_boto3_dlm import DLMClient else: DLMClient = object` or add Pylint comments to suppress specific warnings (e.g., `# pylint: disable=unused-import`).","message":"Pylint can sometimes report `undefined-variable` warnings when `mypy-boto3` imports are only used within `if TYPE_CHECKING:` blocks. This is because Pylint may not correctly interpret these type-checking-only imports at runtime.","severity":"gotcha","affected_versions":"All versions when using Pylint"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}