niklasf / python-chess

A chess library for Python, with move generation and validation, PGN parsing and writing, Polyglot opening book reading, Gaviota tablebase probing, Syzygy tablebase probing, and UCI/XBoard engine communication
https://python-chess.readthedocs.io/en/latest/
GNU General Public License v3.0
2.44k stars 531 forks source link

Drop support for Python 3.9 #564

Open niklasf opened 4 years ago

niklasf commented 4 years ago
bswck commented 7 months ago

TypeAlias can already be used from typing_extensions (with no need of actually having typing_extensions installed, mypy looks up the stub in the typeshed and sees it as a part of the standard library).

niklasf commented 6 months ago

@bswck Interesting. Won't import typing_extensions fail at runtime if it's not present, or is there a way to avoid that?

bswck commented 6 months ago

@bswck Interesting. Won't import typing_extensions fail at runtime if it's not present, or is there a way to avoid that?

Won't fail if we don't perform the import at runtime at all, i.e. in the if typing.TYPE_CHECKING: block. Then we can enable PEP 563 behavior to not evaluate type annotations at runtime.

niklasf commented 6 months ago

Ah, cool. Done.