Skip to content

Commit

Permalink
Do not import FrozenSet by default (#3181)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevkivskyi authored Apr 17, 2017
1 parent db96af3 commit 9aef23b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ def visit_file(self, file_node: MypyFile, fnam: str, options: Options) -> None:

if self.cur_mod_id == 'builtins':
remove_imported_names_from_symtable(self.globals, 'builtins')
for alias_name in ['List', 'Dict', 'Set']:
self.globals.pop(alias_name, None)
for alias_name in type_aliases:
self.globals.pop(alias_name.split('.')[-1], None)

if '__all__' in self.globals:
for name, g in self.globals.items():
Expand Down
2 changes: 2 additions & 0 deletions test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,10 @@ print('>', list(b))
[case testInternalBuiltinDefinition]
import typing
def f(x: _T) -> None: pass
s: FrozenSet
[out]
_program.py:2: error: Name '_T' is not defined
_program.py:3: error: Name 'FrozenSet' is not defined

[case testVarArgsFunctionSubtyping]
import typing
Expand Down

0 comments on commit 9aef23b

Please sign in to comment.