Skip to content

Add utility __pos__ and __neg__ operators to TypeVar #538

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

Closed
wants to merge 1 commit into from

Conversation

mariusvniekerk
Copy link

We already include this in the __repr__.
This makes it easier to explicitly just use +/-T to make generics co/contra-variant.

This makes it easier to explicitly just use +/-T to make generics
co/contra-variant.
@gvanrossum
Copy link
Member

Is this specified by PEP 484? Is it supported by mypy? IIRC we had a discussion about it and decided not to do this. Certainly there should be a discussion about this outside this PR.

@mariusvniekerk
Copy link
Author

Ah right i see in #211. I can close this.

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.

2 participants