Pylint does not discover a NoReturn method in certain cases to avoid "inconsistent-return-statements" #9692
Labels
Enhancement ✨
Improvement to a component
False Positive 🦟
A message is emitted but nothing is wrong with the code
Good first issue
Friendly and approachable by new contributors
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Bug description
Configuration
No response
Command used
Pylint output
Expected behavior
This is a follow-up from: #1782 #4122 #4304
About the failing test cases 4a, 4b, 4d:
4a: seems hard to improve something about it - maybe Pylint could check all usages in the current project, and if all lead consistently to "NoReturn", suppress the warning. In my view checking occurrences alone might not be sensible to do, but wanted to mention the idea.
4b: would be nice if this worked, but is out of scope here, is related to type hint issues #9674 and #4813
4d: if Pylint gets case 4c right, I think it should also work with 4d. If this would be fixed, it would be an alternative to be used to avoid the
inconsistent-return-statements
warning before making use of type hints (4b) or more elaborate introspection (4a?) are available, which might not be soon.Please think about improving Pylint to work also with case 4d.
Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: