Skip to content

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