{"id":3341,"library":"mypy-boto3-billingconductor","title":"mypy-boto3-billingconductor Type Annotations","description":"mypy-boto3-billingconductor provides drop-in type annotations for the `boto3` BillingConductor service. It enhances development with static type checking for `boto3` clients, resources, paginators, and waiters. Maintained by `mypy-boto3-builder`, it is frequently updated to align with `boto3` releases and ensures compatibility with popular IDEs and type checkers like mypy and pyright.","status":"active","version":"1.42.7","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type-hinting","stubs","cloud","billingconductor","python"],"install":[{"cmd":"pip install mypy-boto3-billingconductor boto3","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Provides the runtime functionality; mypy-boto3-billingconductor only supplies type stubs for it.","package":"boto3","optional":false}],"imports":[{"note":"This is the primary way to import the client type for type hinting.","symbol":"BillingConductorClient","correct":"from mypy_boto3_billingconductor.client import BillingConductorClient"},{"note":"Use this for type hinting the service resource.","symbol":"BillingConductorServiceResource","correct":"from mypy_boto3_billingconductor.service_resource import BillingConductorServiceResource"},{"note":"Type definitions for response objects and other complex structures are found in `type_defs`.","symbol":"CreatePricingRuleResponseTypeDef","correct":"from mypy_boto3_billingconductor.type_defs import CreatePricingRuleResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_billingconductor.client import BillingConductorClient\n\nsession = boto3.Session()\nclient: BillingConductorClient = session.client(\"billingconductor\")\n\ntry:\n    # Example: List Pricing Plans (assuming you have some)\n    response = client.list_pricing_plans(\n        MaxResults=5\n    )\n    print(f\"Pricing Plans: {response.get('PricingPlans')}\")\n    print(\"Quickstart executed successfully, type hints are active.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"This is expected if AWS credentials are not configured or no pricing plans exist.\")","lang":"python","description":"This example demonstrates how to set up a `boto3` client for BillingConductor with type annotations provided by `mypy-boto3-billingconductor`. The `TYPE_CHECKING` block ensures that the stub import is only used during type checking, avoiding runtime dependencies. It then attempts to list pricing plans, showcasing basic usage."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. If you must use Python 3.8, you will need to pin to an older `mypy-boto3-billingconductor` version generated with an older builder (e.g., `<1.42.7`).","message":"Python 3.8 support has been removed for packages generated by `mypy-boto3-builder` version 8.12.0 and newer. This specific `mypy-boto3-billingconductor` version (1.42.7) was generated with `builder 8.12.0`.","severity":"breaking","affected_versions":"mypy-boto3-billingconductor versions generated with `mypy-boto3-builder >= 8.12.0`"},{"fix":"Ensure your development environment and type checkers are updated to support PEP 561. Most modern setups (e.g., mypy, pyright, Pylance) handle this automatically.","message":"Packages generated by `mypy-boto3-builder` (version 8.12.0 onwards) have migrated to PEP 561-compliant distribution. While generally seamless, if you have custom build processes or tools that rely on specific stub discovery mechanisms, you might need to verify compatibility.","severity":"breaking","affected_versions":"mypy-boto3-billingconductor versions generated with `mypy-boto3-builder >= 8.12.0`"},{"fix":"Migrate your `pip install` commands from `mypy-boto3` to `types-boto3` (for all services) or directly `mypy-boto3-billingconductor` for specific service stubs.","message":"The original `mypy-boto3` package is now considered 'legacy'. Users are encouraged to install service-specific packages (like `mypy-boto3-billingconductor`) or the umbrella `types-boto3` or `boto3-stubs` packages for type annotations.","severity":"deprecated","affected_versions":"All versions of legacy `mypy-boto3` (not `mypy-boto3-builder`)"},{"fix":"Always install `boto3` alongside `mypy-boto3-billingconductor`: `pip install boto3 mypy-boto3-billingconductor`.","message":"This library only provides type annotations. The actual `boto3` runtime library must be installed separately for your code to execute. Without `boto3` installed, your code will fail at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always add explicit type hints to your `boto3` client and resource objects using the imported types from `mypy_boto3_billingconductor`.","message":"For optimal IDE code completion and faster type checking, especially in older IDEs or specific `mypy` configurations, explicit type annotations (e.g., `client: BillingConductorClient = session.client('billingconductor')`) are recommended rather than relying solely on inference.","severity":"gotcha","affected_versions":"All versions"},{"fix":"As a workaround, outside the `TYPE_CHECKING` block, assign `object` to the imported types (e.g., `else: BillingConductorClient = object`). Alternatively, configure `pylint` to ignore these specific warnings.","message":"When using `if TYPE_CHECKING:` for conditional imports to avoid runtime dependencies, `pylint` may incorrectly report 'undefined variable' errors. This is a known issue with `pylint`.","severity":"gotcha","affected_versions":"All versions when using `pylint` with `TYPE_CHECKING` guards"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}