8000 stubtest: workaround mypyc's issue with vars by hauntsaninja · Pull Request #8411 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

stubtest: workaround mypyc's issue with vars #8411

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 1 commit into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
8000
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import warnings
from functools import singledispatch
from pathlib import Path
from typing import Any, Dict, Generic, Iterator, List, Optional, Tuple, TypeVar, Union
from typing import Any, Dict, Generic, Iterator, List, Optional, Tuple, TypeVar, Union, cast

from typing_extensions import Type

Expand Down Expand Up @@ -236,7 +236,8 @@ def verify_typeinfo(
return

to_check = set(stub.names)
to_check.update(m for m in vars(runtime) if not m.startswith("_"))
# cast to workaround mypyc complaints
to_check.update(m for m in cast(Any, vars)(runtime) if not m.startswith("_"))

for entry in sorted(to_check):
yield from verify(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def run(self):
# Also I think there would be problems with how we generate version.py.
'version.py',

# Written by someone who doesn't know how to deal with mypyc
# Can be removed once we drop support for Python 3.5.2 and lower.
'stubtest.py',
)) + (
# Don't want to grab this accidentally
Expand Down
0