-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False-positive inconsistent-mro
with PySide6
objects
#8704
Comments
Thanks! Looks like #8698 was a little too eager with the diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py
index ce1c9dd5c..7d8676079 100644
--- a/pylint/checkers/typecheck.py
+++ b/pylint/checkers/typecheck.py
@@ -749,8 +749,10 @@ def _no_context_variadic(
def _is_invalid_metaclass(metaclass: nodes.ClassDef) -> bool:
try:
mro = metaclass.mro()
- except (astroid.DuplicateBasesError, astroid.InconsistentMroError):
+ except astroid.DuplicateBasesError:
return True
+ except astroid.InconsistentMroError:
+ return False
return not any(is_builtin_object(cls) and cls.name == "type" for cls in mro) Would you like to prepare a PR? |
I tried this locally, and I am not sure this fixes the issue. At least it's not enough. (Ignore exact line numbers below.)
Either way, there is at least one other |
Right, got it. Okay. The tricky part is that one is downstream of the other (if it's inconsistent-mro, it's also invalid as a metaclass). I guess we can leave this open to track dealing with the fp inconsistent-mro. This probably needs an update in the astroid brain for pyside6. |
Bug description
This is a follow-up to #8698, so I am using
pylint
from master, see version info below. Similar to #1377,pylint
warns about inconsistent MRO withPySide6
objects although the code works fine. The error message is correct for other classes such asPath
, see second part of the example.Configuration
Command used
Pylint output
Expected behavior
No pylint error for
WindowMeta
/MyWindow
Pylint version
OS / Environment
Windows 10 21H2
Additional dependencies
pylint==3.0.0b1
PySide6-Essentials==6.4.3
The text was updated successfully, but these errors were encountered: