-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
unused-import false negative when typing.Annotated has str parameters #7547
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
Comments
I don't understand the example, what does the parameter of annotated refer to according to you ? I think |
What comes after the first parameter to So if I understand correctly, the |
Ok, I think you're right and it's a false negative. |
Just to be sure, we should just ignore any second parameter to |
I think so. mypy ignores the second parameter as well. |
…yping.Annotated`` was treated as a reference to an import. Closes pylint-dev#7547
…yping.Annotated`` was treated as a reference to an import. Closes pylint-dev#7547
…yping.Annotated`` was treated as a reference to an import. Closes pylint-dev#7547
* Fix a false negative for ``unused-import`` when a constant inside ``typing.Annotated`` was treated as a reference to an import. * Update with Daniël's suggestions: - More understandable function parameter name. - Update function parameter type: Expect a tuple of strings. Closes #7547
Bug description
example.py:
Configuration
No response
Command used
Pylint output
Expected behavior
It should report
unused-import
, since the parameter toAnnotated
does not refer topathlib.Path
.Pylint version
OS / Environment
fedora 36
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: