The file py.typed makes the type hints available for use in other projects.
There are still a lot of Anys. In some of those cases Any is fine (__eq__, __ne__, …), but in others I wasn't sure if I can come up with a complete list of allowed values. Eg. what does Principal accept as resources? Maybe ↓?
from typing import TYPE_CHECKING, Union, Sequence
if TYPE_CHECKING:
from troposphere import Ref
from .iam import ARN as IAM_ARN
Resources = Union[str, "IAM_ARN", "Ref", Sequence[Union[str, "IAM_ARN", "Ref"]]
class Principal(AWSHelperFn):
def __init__(self, principal: str, resources: Resources = None) -> None:
...
troposphere.Ref makes it hard/impossible to properly restrict the type hints because awacs does not depend on troposphere and then troposphere.Ref is just Any for all projects that use awacs without troposphere.
Maybe declare (note in changelog) type hints as experimental in the next release to (formally) allow changes without the need of a major version bump.
The file
py.typed
makes the type hints available for use in other projects.There are still a lot of
Any
s. In some of those casesAny
is fine (__eq__
,__ne__
, …), but in others I wasn't sure if I can come up with a complete list of allowed values. Eg. what doesPrincipal
accept asresources
? Maybe ↓?troposphere.Ref
makes it hard/impossible to properly restrict the type hints because awacs does not depend on troposphere and thentroposphere.Ref
is justAny
for all projects that use awacs without troposphere.Maybe declare (note in changelog) type hints as experimental in the next release to (formally) allow changes without the need of a major version bump.