Skip to content

Removes unused imports in mypy #11242

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
Oct 3, 2021
Merged

Removes unused imports in mypy #11242

merged 2 commits into from
Oct 3, 2021

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Oct 1, 2021

Follow up to #11237 and #11235

Maybe we should check this in CI? 🤔

@JelleZijlstra
Copy link
Member

Why doesn't flake8 find this, actually?

@sobolevn
Copy link
Member Author

sobolevn commented Oct 2, 2021

@JelleZijlstra let's take a look at https://github.com/python/mypy/pull/11242/files#diff-91900391ac75c32e76d37331a68d7f0b91bbdc2323d7919a36a87ecc43899499L5

In this case, if I run flake8 --isolated mypy/expandtype.py it reports:

mypy/expandtype.py:3:1: F811 redefinition of unused 'TypeVarType' from line 3

It does not report F401 'TypeVarType' imported but unused for some reason.

But, F811 is ignored in setup.cfg: https://github.com/python/mypy/blob/master/setup.cfg#L45

This looks like a bug in flake8 to me.

@hauntsaninja hauntsaninja merged commit 1b6f63b into python:master Oct 3, 2021
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.

3 participants