Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 27, 2022
1 parent 99fdf0d commit cfc9a7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion astroid/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def path_wrapper(func: Callable) -> Callable:
"""

@functools.wraps(func)
def wrapped(node, context: InferenceContext | None = None, _func=func, **kwargs) -> Iterator:
def wrapped(
node, context: InferenceContext | None = None, _func=func, **kwargs
) -> Iterator:
"""wrapper function handling context"""
if context is None:
context = InferenceContext()
Expand Down
12 changes: 9 additions & 3 deletions astroid/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def infer_end(
nodes.Slice._infer = infer_end # type: ignore[assignment]


def _infer_sequence_helper(node: _BaseContainerT, context: InferenceContext | None = None) -> list[nodes.NodeNG]:
def _infer_sequence_helper(
node: _BaseContainerT, context: InferenceContext | None = None
) -> list[nodes.NodeNG]:
"""Infer all values based on _BaseContainer.elts"""
values = []

Expand Down Expand Up @@ -743,7 +745,9 @@ def _bin_op(
)


def _get_binop_contexts(context: InferenceContext, left, right) -> Iterator[InferenceContext]:
def _get_binop_contexts(
context: InferenceContext, left, right
) -> Iterator[InferenceContext]:
"""Get contexts for binary operations.
This will return two inference contexts, the first one
Expand Down Expand Up @@ -1139,7 +1143,9 @@ def infer_empty_node(
nodes.EmptyNode._infer = infer_empty_node # type: ignore[assignment]


def _populate_context_lookup(call: nodes.Call, context: InferenceContext | None) -> dict[nodes.NodeNG, InferenceContext]:
def _populate_context_lookup(
call: nodes.Call, context: InferenceContext | None
) -> dict[nodes.NodeNG, InferenceContext]:
# Allows context to be saved for later
# for inference inside a function
context_lookup: dict[nodes.NodeNG, InferenceContext] = {}
Expand Down

0 comments on commit cfc9a7b

Please sign in to comment.