8000 Fix ``mypy`` warnings for ``astroid/rebuilder`` by DanielNoord · Pull Request #1244 · pylint-dev/astroid · GitHub
[go: up one dir, main page]

Skip to content

Fix mypy warnings for astroid/rebuilder #1244

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

Merged
merged 7 commits into from
Nov 24, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Code review
  • Loading branch information
DanielNoord committed Nov 17, 2021
commit d65cae9968b543bfbfdf73dbb868a5302e5e5cdb
6 changes: 2 additions & 4 deletions astroid/rebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,12 +875,10 @@ def visit_arguments(self, node: "ast.arguments", parent: NodeNG) -> nodes.Argume
type_comment_posonlyargs=type_comment_posonlyargs,
)
# save argument names in locals:
if not newnode.parent:
raise ParentMissingError(target=newnode)
if vararg:
newnode.parent.set_local(vararg, newnode)
newnode.parent.set_local(vararg, newnode) # type: ignore[union-attr] # newnode is initialized with a parent
if kwarg:
newnode.parent.set_local(kwarg, newnode)
newnode.parent.set_local(kwarg, newnode) # type: ignore[union-attr] # newnode is initialized with a parent
return newnode

def visit_assert(self, node: "ast.Assert", parent: NodeNG) -> nodes.Assert:
Expand Down
0