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

Full PEP 695+696 support (after Autumn 2027) #62

Open
abelcheung opened this issue Oct 2, 2024 · 2 comments
Open

Full PEP 695+696 support (after Autumn 2027) #62

abelcheung opened this issue Oct 2, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@abelcheung
Copy link
Owner

abelcheung commented Oct 2, 2024

(Won't happen anytime soon, unless ditching mypy support right here and right now)

With mypy 1.11 requirement present, the time is probably ripe for support of full type parameter syntax (def func[T](...)).

@abelcheung abelcheung converted this from a draft issue Oct 2, 2024
@abelcheung abelcheung added the enhancement New feature or request label Oct 2, 2024
@abelcheung abelcheung self-assigned this Oct 14, 2024
@abelcheung
Copy link
Owner Author

I'm too naïve, mypy isn't ready yet when bringing PEP696 into equation, even with newest mypy 1.12 and python 3.13:

lxml-stubs\etree\_element.pyi:229: error: Type parameter default types not supported when using Python 3.12 type parameter syntax [misc]
    class _ElementTree[E: _Element = _Element]:

Apparently still being worked on (python/mypy#14851). pyright does fine since 1.1.351 (or before).

@abelcheung abelcheung changed the title Full PEP 695 support Full PEP 695+696 support Oct 15, 2024
@abelcheung abelcheung moved this from Backlog to On Hold in Types-lxml progress Oct 15, 2024
@abelcheung
Copy link
Owner Author

Turns out lack of PEP696 support is a lesser problem. mypy requires python 3.12 to type check code with new Generic syntax, and --python-version argument is ignored if the python interpreter running mypy isn't at least 3.12. This means project maintainers using types-lxml are forced to use py3.12 as minimum dependency, otherwise they can't type check their code.

Throwing mypy out of window isn't an option here; it would be a great disservice to those using this annotation package. The only other option is to wait till Python 3.11 is EOLed and make an excuse that we don't support EOLed python versions.

@abelcheung abelcheung changed the title Full PEP 695+696 support Full PEP 695+696 support (after Autumn 2027) Oct 15, 2024
@abelcheung abelcheung removed their assignment Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: On Hold
Development

No branches or pull requests

1 participant