Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add typing to
NodeNG.nodes_of_class
#1168Add typing to
NodeNG.nodes_of_class
#1168Changes from 3 commits
bb682a0
86c559f
fbd24e2
5e9baf9
80e5627
4b60299
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Just realized that we would need to add this to every call in
pylint
as well 😕The issue should probably be fixed before we can merge it.
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.
I did a
pip install -e local_astroid_folder
and succeeded in running the pre-commit to test for this. (in my local pylint folder of course)The problem comes from
overload
s where the...
is on a separate line (I think).We don't have those in pylint (yet), so I think for the time-being we are fine.
You might want to check this though by doing
pip -e
as well, just to be sure!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.
Just tested it as well and you're right. At the moment
pylint
doesn't complain. The reason however isn't that we don't useoverloads
. It's actually thatnode
invisit_xxx(self, node)
cannot be inferred and thus no error is emitted. In contrast, just doing something like this will easily produce one: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.
Didn't we just add typing to all
visit_xxx(self, node)
calls inpylint
? Or is that not enough to helpmypy
?I saw you just assigned somebody to #1015. I think we should block this until that issue has been fixed, right?
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.
Except from some corner cases, type annotations aren't used to infer values in pylint. That is different in
mypy
.Since this doesn't actually cause any issues with
pylint
, I would say we can merge it now. It doesn't necessarily need to wait for #1015.