Add typing.ClassVar (fixes #888)#889
Conversation
|
To resolve #888, this should also be added to stdlib/2/typing.pyi. |
|
Looks like adding
Should I ignore it or remove version check from stdlib/2? Is it actually needed there? Python docs mention it was added in 3.5.3. I think it could be clarified in CONTRIBUTING file. |
|
Oh, actually this should not be conditional at all.
…--Guido (mobile)
On Jan 29, 2017 4:13 PM, "miedzinski" ***@***.***> wrote:
Looks like adding import sys to stdlib/2/typing.pyi causes
stdlib/2/types.pyi:16: error: Cannot determine type of 'long'
Should I ignore it or remove version check from stdlib/2? Is it actually
needed there? Python docs mention it was added in 3.5.3. I think it could
be clarified in CONTRIBUTING
<https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#stub-versioning>
file.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#889 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMqAmRAmSujWJpkXdjytdeJZFIETeks5rXSsNgaJpZM4LwoFU>
.
|
|
That makes more sense. :) There are comments in that stub that convinced me that https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#stub-versioning doesn't help either. |
|
That comment refers to types that are defined in the language or in other parts of the stdlib, and only appear in newer Python versions. But ClassVar is unconditionally defined in typing.py, so it will work whenever a new enough typing.py is present. (True, it won't exist in the stdlib version for Python 3.5.0--3.5.2, but that's where that section in CONTRIBUTING.md applies -- it does exist in the stdlib for 3.5.3.) Anyway, this still requires changes to mypy as well -- we're tracking that in python/mypy#2771. |
As title says. Resolves #888.