Skip to content

Do not import FrozenSet by default #3181

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
Apr 17, 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
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