Skip to content

Examples#

Index > TaxSettings > Examples

Auto-generated documentation for TaxSettings type annotations stubs module mypy-boto3-taxsettings.

Client#

Implicit type annotations#

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

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

# TaxSettingsClient usage example

from boto3.session import Session


session = Session()

client = session.client("taxsettings")  # (1)
result = client.batch_delete_tax_registration()  # (2)
  1. client: TaxSettingsClient
  2. result: BatchDeleteTaxRegistrationResponseTypeDef
# ListTaxRegistrationsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("taxsettings")  # (1)

paginator = client.get_paginator("list_tax_registrations")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: TaxSettingsClient
  2. paginator: ListTaxRegistrationsPaginator
  3. item: ListTaxRegistrationsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[taxsettings] or a standalone mypy_boto3_taxsettings package, you have to explicitly specify client: TaxSettingsClient 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.

# TaxSettingsClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_taxsettings.client import TaxSettingsClient
from mypy_boto3_taxsettings.type_defs import BatchDeleteTaxRegistrationResponseTypeDef
from mypy_boto3_taxsettings.type_defs import BatchDeleteTaxRegistrationRequestRequestTypeDef


session = Session()

client: TaxSettingsClient = session.client("taxsettings")

kwargs: BatchDeleteTaxRegistrationRequestRequestTypeDef = {...}
result: BatchDeleteTaxRegistrationResponseTypeDef = client.batch_delete_tax_registration(**kwargs)
# ListTaxRegistrationsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_taxsettings.client import TaxSettingsClient
from mypy_boto3_taxsettings.paginator import ListTaxRegistrationsPaginator
from mypy_boto3_taxsettings.type_defs import ListTaxRegistrationsResponseTypeDef


session = Session()
client: TaxSettingsClient = session.client("taxsettings")

paginator: ListTaxRegistrationsPaginator = client.get_paginator("list_tax_registrations")
for item in paginator.paginate(...):
    item: ListTaxRegistrationsResponseTypeDef
    print(item)