Using classes "defined as generic in stubs but not at runtime" as base class triggers inherit-non-class #4697
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Hacktoberfest
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
pylint>=2.9.0
triggers a false positive ofinherit-non-class
when using a class as base that was defined as a generic in a stub (or mypy plugin) but not at runtime when using the recommended workaround from mypy.Steps to reproduce
Consider this file:
Current behavior
pylint>=2.9.0
triggersinherit-non-class
, version2.8.3
does not yet trigger that error.It should be noted that a workaround is to invert the if/else statement like this:
... which will not trigger the error. Still of course, something is clearly happening that is not intended.
Expected behavior
... not trigger that error, obviously ;-)
The text was updated successfully, but these errors were encountered: