-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Relax TypeVar default ordering constraints #118772
Comments
https://github.com/python/cpython/actions/runs/9004596703/job/24737976172?pr=118766 for reference. This is currently breaking our Hypothesis tests on the main branch. |
I think that first example should raise but I agree that the second raising is buggy |
They're the same example though, in the sense that the code for |
It's different as described by the binding rules. The class typevar is bound on the attribute access then the default disappears. I don't feasibly see a way to implement this at runtime however so the changes are still fine. |
…fault when constructing aliases (#118774)
I think this is complete now, but please reopen if I'm mistaken! |
Bug report
Bug description:
This can reasonably happen if you have a generic class generic over a TypeVar with a default, and that TypeVar appears in a Callable parameter type annotation:
We encountered this in Hypothesis.
cc @Gobot1234
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: