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

Updated spec and conformance test to reflect that a type variable tha… #1576

Merged
merged 5 commits into from
Jan 13, 2024

Conversation

erictraut
Copy link
Collaborator

…t is defined as covariant or contravariant should not generate an error when bound to a generic function or type alias. Variance has no meaning in this context, so it should be ignored. This brings the spec in alignment with the behavior of the major type checkers.

…t is defined as covariant or contravariant should not generate an error when bound to a generic function or type alias. Variance has no meaning in this context, so it should be ignored. This brings the spec in alignment with the behavior of the major type checkers.
@hauntsaninja
Copy link
Collaborator

Linking python/typing-council#8

@erictraut erictraut merged commit a17d8a3 into python:main Jan 13, 2024
3 checks passed
@erictraut erictraut deleted the typevar_variance branch January 13, 2024 22:15
@hauntsaninja
Copy link
Collaborator

@erictraut should this have been merged before python/typing-council#8 got resolved?

@erictraut
Copy link
Collaborator Author

Oops, I mixed up this PR with another one. I didn't mean to merge this one yet. I'll revert it.

@erictraut
Copy link
Collaborator Author

Note to self: Use the "Draft" feature so it's obvious that a PR isn't yet ready to merge.

erictraut added a commit to erictraut/typing that referenced this pull request Jan 15, 2024
@erictraut
Copy link
Collaborator Author

erictraut commented Jan 15, 2024

Here's the PR that reverts this one: #1586. I'll create a new PR that re-applies this one and make sure to mark it as Draft this time.

Edit: Here's the new draft PR: #1587.

erictraut added a commit that referenced this pull request Jan 15, 2024
Reverted #1576. It wasn't meant to be merged yet because the TC hasn't bottomed out on the discussion.
@hauntsaninja
Copy link
Collaborator

Thanks! :-) I added some labels so hopefully we confuse ourselves less in the future

hauntsaninja pushed a commit to hauntsaninja/typing that referenced this pull request Jan 16, 2024
python#1576)

* Updated spec and conformance test to reflect that a type variable that is defined as covariant or contravariant should not generate an error when bound to a generic function or type alias. Variance has no meaning in this context, so it should be ignored. This brings the spec in alignment with the behavior of the major type checkers.

* Added comment as per PR suggestion.

* Reran tests.

* Fixed a botched merge that undid a previous PR.
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

Successfully merging this pull request may close these issues.

3 participants