Skip to content

Now ClassVar cannot contain type variables, refs #11538 #11585

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

Merged
merged 2 commits into from
Nov 24, 2021
Merged

Now ClassVar cannot contain type variables, refs #11538 #11585

merged 2 commits into from
Nov 24, 2021

Conversation

sobolevn
Copy link
Member

Some tests might fail, because I've only checked semanal test suite. I will fix them after the initial CI run.

Closes #11538

'semanal-classvar.test',
'semanal-python2.test',
'semanal-lambda.test']
semanal_files = [
Copy link
Member Author

Choose a reason for hiding this comment

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

This change is important to me, because I use cmd + # to comment out all the files and uncomment only a single one I am interested in.

With the previous format it is impossible to do.

Btw, is there any more useful way to run all tests in a file?

Copy link
Collaborator

Choose a reason for hiding this comment

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

pytest ./mypy/test/testsemanal.py works well for me. pytest -k search_phrase is also really useful

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but pytest ./mypy/test/testsemanal.py will run all semanal-*.test files.
I am asking about a single .test file, for example only semanal-classvar.test

@github-actions

This comment has been minimized.

@sobolevn
Copy link
Member Author

All testeval.py tests fail, because we need to merge python/typeshed#6348 and sync typeshed.

 ----------------------------- Captured stdout call -----------------------------
mypy/typeshed/stdlib/ctypes/__init__.pyi:176: error: ClassVar cannot contain type variables
mypy/typeshed/stdlib/ctypes/__init__.pyi:272: error: ClassVar cannot contain type variables

CC @JelleZijlstra

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

edgedb (https://github.com/edgedb/edgedb.git)
+ edb/common/parametric.py:321:5: error: ClassVar cannot contain type variables
+ edb/common/parametric.py:326:5: error: ClassVar cannot contain type variables
+ edb/common/parametric.py:327:5: error: ClassVar cannot contain type variables
+ edb/schema/delta.py:1655:5: error: ClassVar cannot contain type variables

@sobolevn
Copy link
Member Author

@JukkaL yes, #11600 solved it! 🎉

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.

generic mutable class attributes introduce a vent in the type system
2 participants