Skip to content

Spurious unused-import warning when imported variable is used as metaclass or as function annotation #143

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

Closed
pylint-bot opened this issue Jan 29, 2014 · 3 comments
Labels

Comments

@pylint-bot
Copy link

Originally reported by: Antony Lee (BitBucket: anntzer, GitHub: @anntzer?)


#!python
from abc import ABCMeta

class C(metaclass=ABCMeta):
    pass

def f(arg: ABCMeta):
    pass

Pylint doesn't detect either use of ABCMeta and warns that the import is unused.

I first created this issue on the astroid tracker (https://bitbucket.org/logilab/astroid/issue/14/spurious-unused-import-warning-when) but @PCManticore suggested that I move it here.


@pylint-bot
Copy link
Author

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


Fix unused-import false positive with Python 3 metaclasses. Closes issue #143.

@pylint-bot
Copy link
Author

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


I just fix the first component of this issue. The part with annotations can't be fixed right now, I have to deal with https://bitbucket.org/logilab/astroid/issue/30/function-annotation-support first.

@pylint-bot
Copy link
Author

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


See #227 for the annotation issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant