False positive E1133 (not-an-iterable) when returning (type hinted) class variable #10298
Labels
Control flow
Requires control flow understanding
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Bug description
When returning a class variable from an instance the type is not correctly detected and E1133 is raised although a list will be returned.
To show I use 2 classes where one returns an instance variable and the other a class variable. The annotation is only shown for the class variable:
This might be related to #6044 which also uses a class variable and/or #2766 which tries to solve a similar issue with type hints.
Command used
Pylint output
Expected behavior
No warning show for either case and/or at least being able to silence it using standard Python type hints as shown.
Pylint version
OS / Environment
No response
The text was updated successfully, but these errors were encountered: