Skip to content

Commit 7954bac

Browse files
correctmostDanielNoord
authored andcommitted
Fix most of the mypy errors in astroid/nodes/as_string.py
1 parent 8573b68 commit 7954bac

File tree

8 files changed

+100
-95
lines changed

8 files changed

+100
-95
lines changed

astroid/arguments.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(
5454
}
5555

5656
@classmethod
57-
def from_call(cls, call_node, context: InferenceContext | None = None):
57+
def from_call(cls, call_node: nodes.Call, context: InferenceContext | None = None):
5858
"""Get a CallSite object from the given Call node.
5959
6060
context will be used to force a single inference path.
@@ -65,7 +65,7 @@ def from_call(cls, call_node, context: InferenceContext | None = None):
6565
callcontext = CallContext(call_node.args, call_node.keywords)
6666
return cls(callcontext, context=context)
6767

68-
def has_invalid_arguments(self):
68+
def has_invalid_arguments(self) -> bool:
6969
"""Check if in the current CallSite were passed *invalid* arguments.
7070
7171
This can mean multiple things. For instance, if an unpacking
@@ -89,7 +89,7 @@ def _unpack_keywords(
8989
self,
9090
keywords: list[tuple[str | None, nodes.NodeNG]],
9191
context: InferenceContext | None = None,
92-
):
92+
) -> dict[str | None, InferenceResult]:
9393
values: dict[str | None, InferenceResult] = {}
9494
context = context or InferenceContext()
9595
context.extra_context = self.argument_context_map

astroid/brain/brain_builtin_inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def _infer_builtin_container(
372372

373373

374374
def _get_elts(arg, context):
375-
def is_iterable(n):
375+
def is_iterable(n) -> bool:
376376
return isinstance(n, (nodes.List, nodes.Tuple, nodes.Set))
377377

378378
try:

astroid/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def sort_locals(my_list: list[nodes.NodeNG]) -> None:
233233
sort_locals(node.parent.scope().locals[asname or name]) # type: ignore[arg-type]
234234

235235
def delayed_assattr(self, node: nodes.AssignAttr) -> None:
236-
"""Visit a AssAttr node.
236+
"""Visit an AssignAttr node.
237237
238238
This adds name to locals and handle members definition.
239239
"""

0 commit comments

Comments
 (0)