KEMBAR78
Use `__truediv__` for python2 with `__future__` import, refs #11740 by sobolevn · Pull Request #11787 · python/mypy · GitHub
Skip to content

Conversation

@sobolevn
Copy link
Member

Now __future__ imports do not leak in semanal.py.

Closes #11740
Refs #11741
Refs #11276
Refs #11700

mypy/semanal.py Outdated
plugin: Plugin # Mypy plugin for special casing of library features
statement: Optional[Statement] = None # Statement/definition being analyzed
future_import_flags: Set[str]
future_import_flags: Dict[str, Set[str]] # Module name / future imports
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could these be stored in MypyFile instead, to avoid two dictionaries keyed with a module name (see modules above)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! 👍

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks!

@JukkaL JukkaL merged commit 14de8c6 into python:master Feb 23, 2022
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.

Python 2 future import can leak between modules

2 participants