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

Add TypeVar(infer_variance=True) #80

Merged
merged 1 commit into from Oct 6, 2022

Conversation

JelleZijlstra
Copy link
Member

From PEP 695. Fixes #79.

@JelleZijlstra
Copy link
Member Author

I decided here not to add infer_variance support to ParamSpec. ParamSpec supports covariant=/contravariant= at runtime, but the behavior is unspecified. PEP 695 only mentions the infer_variance parameter for TypeVar.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe add a mention to the README?

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than maybe needing an addition to the README!

@JelleZijlstra
Copy link
Member Author

Thanks! I'll improve the README in a separate PR.

@JelleZijlstra JelleZijlstra merged commit ba776ea into python:main Oct 6, 2022
@JelleZijlstra JelleZijlstra deleted the infervar branch October 6, 2022 21:54
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.

Add support for TypeVar(infer_variance=True) (PEP 695)
2 participants