由mypyboto3buider 4.2.0生成的boto3.ElasticLoadBalancing 1.16.35服务的类型注释
mypy-boto3-elb的Python项目详细描述
mypy-boto3-elb型
的类型批注 boto3.ElasticLoadBalancing 1.16.35服务 兼容 VSCode, PyCharm, Emacs, Sublime Text, mypy, pyright 以及其他工具。在
更多信息可在boto3-stubs页找到。在
了解它如何帮助查找和修复潜在的错误:
如何安装
为ElasticLoadBalancing
服务安装boto3-stubs
。在
python -m pip install boto3-stubs[elb]
使用
VSCode
- {a29}安装
- 安装Pylance extension
- 将
Pylance
设置为Python语言服务器 - 在您的环境中安装
boto-stubs[elb]
:python -m pip install 'boto3-stubs[elb]'
类型检查和自动完成都应该适用于ElasticLoadBalancing
服务。
不需要显式的类型注释,请照常编写boto3
代码。在
PyCharm
- 在您的环境中安装
boto-stubs[elb]
:python -m pip install 'boto3-stubs[elb]'
类型检查和自动完成都应该适用于ElasticLoadBalancing
服务。
不需要显式的类型注释,请照常编写boto3
代码。
自动完成在大型项目或安装了大量boto3-stubs
子模块时可能会很慢。在
其他IDE
没有经过测试,但是只要您的IDE支持mypy
或{
mypy
- 安装
mypy
:python -m pip install mypy
- 在您的环境中安装
boto-stubs[elb]
:python -m pip install 'boto3-stubs[elb]'
- 像往常一样运行
mypy
类型检查应该适用于ElasticLoadBalancing
服务。
不需要显式的类型注释,请照常编写boto3
代码。在
pyright
- 安装
pyright
:yarn global add pyright
- 在您的环境中安装
boto-stubs[elb]
:python -m pip install 'boto3-stubs[elb]'
- 或者,您可以将
boto3-stubs
安装到typings
文件夹中。在
类型检查应该适用于ElasticLoadBalancing
服务。
不需要显式的类型注释,请照常编写boto3
代码。在
显式类型批注
客户端注释
ElasticLoadBalancingClient
为boto3.client("elb")
提供注释。在
分页器注释
mypy_boto3_elb.paginator
模块包含所有分页器的类型注释。在
frommypy_boto3_elbimportElasticLoadBalancingClientfrommypy_boto3_elb.paginatorimportDescribeAccountLimitsPaginator,DescribeLoadBalancersPaginatorclient:ElasticLoadBalancingClient=boto3.client("elb")# Explicit type annotations are optional here# Type should be correctly discovered by mypy and IDEs# VSCode requires explicit type annotationsdescribe_account_limits_paginator:DescribeAccountLimitsPaginator=client.get_paginator("describe_account_limits")describe_load_balancers_paginator:DescribeLoadBalancersPaginator=client.get_paginator("describe_load_balancers")
服务员注释
mypy_boto3_elb.waiter
模块包含所有等待者的类型注释。在
frommypy_boto3_elbimportElasticLoadBalancingClientfrommypy_boto3_elb.waiterimport(AnyInstanceInServiceWaiter,InstanceDeregisteredWaiter,InstanceInServiceWaiter,)client:ElasticLoadBalancingClient=boto3.client("elb")# Explicit type annotations are optional here# Type should be correctly discovered by mypy and IDEs# VSCode requires explicit type annotationsany_instance_in_service_waiter:AnyInstanceInServiceWaiter=client.get_waiter("any_instance_in_service")instance_deregistered_waiter:InstanceDeregisteredWaiter=client.get_waiter("instance_deregistered")instance_in_service_waiter:InstanceInServiceWaiter=client.get_waiter("instance_in_service")
键入<3词>
mypy_boto3_elb.type_defs
模块包含组合的结构和形状
以进行额外的类型检查。在
frommypy_boto3_elb.type_defsimport(AccessLogTypeDef,AddAvailabilityZonesOutputTypeDef,AdditionalAttributeTypeDef,AppCookieStickinessPolicyTypeDef,ApplySecurityGroupsToLoadBalancerOutputTypeDef,AttachLoadBalancerToSubnetsOutputTypeDef,BackendServerDescriptionTypeDef,ConfigureHealthCheckOutputTypeDef,ConnectionDrainingTypeDef,ConnectionSettingsTypeDef,CreateAccessPointOutputTypeDef,CrossZoneLoadBalancingTypeDef,DeregisterEndPointsOutputTypeDef,DescribeAccessPointsOutputTypeDef,DescribeAccountLimitsOutputTypeDef,DescribeEndPointStateOutputTypeDef,DescribeLoadBalancerAttributesOutputTypeDef,DescribeLoadBalancerPoliciesOutputTypeDef,DescribeLoadBalancerPolicyTypesOutputTypeDef,DescribeTagsOutputTypeDef,DetachLoadBalancerFromSubnetsOutputTypeDef,HealthCheckTypeDef,InstanceStateTypeDef,InstanceTypeDef,LBCookieStickinessPolicyTypeDef,LimitTypeDef,ListenerDescriptionTypeDef,ListenerTypeDef,LoadBalancerAttributesTypeDef,LoadBalancerDescriptionTypeDef,ModifyLoadBalancerAttributesOutputTypeDef,PaginatorConfigTypeDef,PoliciesTypeDef,PolicyAttributeDescriptionTypeDef,PolicyAttributeTypeDef,PolicyAttributeTypeDescriptionTypeDef,PolicyDescriptionTypeDef,PolicyTypeDescriptionTypeDef,RegisterEndPointsOutputTypeDef,RemoveAvailabilityZonesOutputTypeDef,ResponseMetadata,SourceSecurityGroupTypeDef,TagDescriptionTypeDef,TagKeyOnlyTypeDef,TagTypeDef,WaiterConfigTypeDef,)defget_structure()->AccessLogTypeDef:return{...}
- 项目
标签: