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 Final to typing_extensions #583

Merged
merged 5 commits into from
Sep 13, 2018
Merged

Conversation

ilevkivskyi
Copy link
Member

This is a runtime counterpart of an experimental feature added to mypy in python/mypy#5522

This implementation just mimics the behaviour of ClassVar on all Python/typing versions, which is probably the most reasonable thing to do.

@JukkaL
Copy link
Contributor

JukkaL commented Sep 12, 2018

If this will be moved to typing, I hope there is a way to share code with the implementation of ClassVar. This is a lot of code for a relatively minor feature, but it's less of a problem if most of it goes away in the long term.

@ilevkivskyi
Copy link
Member Author

In Python 3.7 it will be literally one line (not counting the docstring). But the point of typing_extensions is to be compatible with all versions of typing.

@msullivan msullivan self-requested a review September 12, 2018 17:24
Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

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

This seems reasonable. At least, the newer the version being hooked into, the more reasonable it seems.

@ilevkivskyi
Copy link
Member Author

OK, if there are no suggestions, I will merge this later today. We can release a new version of typing_extensions later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants