-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Remove most typing.cast()
calls
#4995
Conversation
Pull Request Test Coverage Report for Build 1237960833
π - Coveralls |
The -- scope = cast(nodes.NodeNG, node.scope()) |
I think this is a typo. I didn't change
Can we use cast to type |
You mentioned it in the PR description. Only wanted to comment on that.
I wouldn't recommend that. My rule for
Left some comments on pylint-dev/astroid#1170. |
Ah, that was
ππ» |
This is (potentially) blocked by pylint-dev/astroid#1170 as it would allow removing one additional |
We can wait for astroid 2.8, then, there's only two merge request to handle now : https://github.com/PyCQA/astroid/milestone/16 |
Temporarily marked it as draft. Just until the PR is merged |
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.
LGTM !
Still blocked by pylint-dev/astroid#1170 |
This does need |
Type of Changes
Description
After merge of pylint-dev/astroid#1168 I was asked to work on this.
I left in
threetwo calls.One and two (because
mypy
/IDE fails to see L120-122):https://github.com/PyCQA/pylint/blob/ab327e6c9394dcdf9492996865a8b120da6bd4bc/pylint/extensions/code_style.py#L120-L147
Three (becauseNodeNG.scope()
is not typed and we therefore lose typing onscope
):https://github.com/PyCQA/pylint/blob/ab327e6c9394dcdf9492996865a8b120da6bd4bc/pylint/checkers/refactoring/recommendation_checker.py#L122-L124