conda-incubator / conda-store

Data science environments, for collaboration. ✨
https://conda.store
BSD 3-Clause "New" or "Revised" License
139 stars 45 forks source link

Update code to use built-in collections for type annotations #711

Open nkaretnikov opened 7 months ago

nkaretnikov commented 7 months ago

Context

Requested in https://github.com/conda-incubator/conda-store/pull/693#discussion_r1427172308.

These new type hints were introduced in Python 3.9: https://docs.python.org/3/whatsnew/3.9.html#type-hinting-generics-in-standard-collections

Python 3.8 was released on 2019-10-14 and its EOL is 2024-10, so we can drop support for it soon: https://devguide.python.org/versions/

Value and/or benefit

From https://peps.python.org/pep-0585/

This change removes the necessity for a parallel type hierarchy in the typing module, making it easier for users to annotate their programs and easier for teachers to teach Python.

Anything else?

No response