Skip to content

Revert reveal_type message fix #3267

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
Apr 27, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions mypy/fixup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
)
from mypy.visitor import NodeVisitor

from mypy.semanal import rev_module_rename_map


def fixup_module_pass_one(tree: MypyFile, modules: Dict[str, MypyFile],
quick_and_dirty: bool) -> None:
Expand Down Expand Up @@ -243,9 +241,6 @@ def lookup_qualified(modules: Dict[str, MypyFile], name: str,

def lookup_qualified_stnode(modules: Dict[str, MypyFile], name: str,
quick_and_dirty: bool) -> Optional[SymbolTableNode]:
if '_importlib_modulespec' in modules:
# we are using python 3, so renaming is necessary
name = rev_module_rename_map.get(name, name)
head = name
rest = []
while True:
Expand Down
16 changes: 0 additions & 16 deletions mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,6 @@
'typing.typevar': 'typing.TypeVar',
}

# Used for python 3 only
# Rename objects placed in _importlib_modulespec due to circular imports
# Safe in python 2 because no one will ask for these keys
module_rename_map = {
'_importlib_modulespec.ModuleType': 'types.ModuleType',
'_importlib_modulespec.ModuleSpec': 'importlib.machinery.ModuleSpec',
'_importlib_modulespec.Loader': 'importlib.abc.Loader'
}

# Must not be used in python 2 (it will replace correct names with incorrect)
# The check for version is currently made at the point of use
# TODO: consider moving these maps from global scope to somewhere where python version is known
rev_module_rename_map = {v: k for (k, v) in module_rename_map.items()}

# Hard coded type promotions (shared between all Python versions).
# These add extra ad-hoc edges to the subtyping relation. For example,
# int is considered a subtype of float, even though there is no
Expand Down Expand Up @@ -3339,8 +3325,6 @@ def visit_file(self, file: MypyFile, fnam: str, mod_id: str, options: Options) -

for d in defs:
d.accept(self)
if isinstance(d, ClassDef):
d.info._fullname = module_rename_map.get(d.info._fullname, d.info._fullname)

# Add implicit definition of literals/keywords to builtins, as we
# cannot define a variable with them explicitly.
Expand Down