Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to new type aliases #11

Open
bswck opened this issue Jul 26, 2024 · 0 comments
Open

Migrate to new type aliases #11

bswck opened this issue Jul 26, 2024 · 0 comments

Comments

@bswck
Copy link
Contributor

bswck commented Jul 26, 2024

PEP 585 combined with PEP 563 allows to use types directly (not their typing runtime aliases).
So, for example:

  • let's not import Callable from typing, but from collections.abc instead
  • let's not import typing.Type, but use the built-in type instead

etc., since

  1. we are using __future__.annotations
  2. we're not evaluating generic type annotations such as Iterable[...] at runtime (breaks compatibility with Python 3.8).

PEP 604 combined with PEP 563 allows to drop typing.Union, although not deprecated.

@bswck bswck mentioned this issue Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant