aio-libs / aiobotocore

asyncio support for botocore library using aiohttp

Home Page:https://aiobotocore.rtfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Large unnamed inline Union types impacts developer ergonomics

perlow opened this issue · comments

An example of this is LastEvaluatedKey of ScanOutputTableTypeDef. It has the inline-type

  Dict[
            str,
            Union[
                bytes,
                bytearray,
                str,
                int,
                Decimal,
                bool,
                Set[int],
                Set[Decimal],
                Set[str],
                Set[bytes],
                Set[bytearray],
                Sequence[Any],
                Mapping[str, Any],
                None,
            ],
        ]

This means that if code calling table.scan needs to return this to its caller, it needs to replicate that very large type definition. Ideally, this would be a named type like LastEvaluatedKeyTypeDef which could then be referenced in application code.

where is this? Are you sure this is aiobotocore and not botocore?