-
-
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
Fix FunctionDef
isinstance checks
#8607
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8607 +/- ##
=======================================
Coverage 95.92% 95.92%
=======================================
Files 174 174
Lines 18415 18415
=======================================
Hits 17664 17664
Misses 751 751
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just so all reviewers are aware, we will still need another round of cleanup after bumping to astroid 2.16, when we could remove things like this last line:
pylint/pylint/checkers/typecheck.py
Lines 676 to 678 in 3d036b7
if ( | |
isinstance(scope, nodes.Lambda) | |
and not isinstance(scope, nodes.FunctionDef) |
Either then or now, we could tidy up some comments like this:
There's also a comment to clean up in `_determine_callable(), but we can do that later:
pylint/pylint/checkers/typecheck.py
Lines 614 to 615 in 3d036b7
# Ordering is important, since BoundMethod is a subclass of UnboundMethod, | |
# and Function inherits Lambda. |
Yeah, I think this change is very likely to cause a need to do a Thanks @cdce8p and @jacobtylerwalls for taking these first steps towards compatibility! |
Agree about 3.0. Let's slow the release cadence down for a little bit, and release both 3.0 in pylint and astroid when we're ready for python 3.12. We may not need a 4.0 then. |
Also fine with me, although we should definitely release |
+1, we can keep the release cadence by releasing alpha/betas and still wait to support python 3.12 for pylint 3.0. There's a lot to do in #3512 still, we'll probably release pylint 3.0 after python 3.12 is out in any case. |
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉 This comment was generated for commit 3bc915a |
Description
Fallout from pylint-dev/astroid#2115 - required for the next astroid update.
Fix
isinstance
checks now thatnodes.FunctionDef
doesn't inherit fromnodes.Lambda
.Changes are compatible with the current astroid version, so don't need to wait to fix these.