summaryrefslogtreecommitdiff
path: root/astroid/bases.py
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-06-07 23:06:41 +0200
committerGitHub <noreply@github.com>2022-06-07 23:06:41 +0200
commit01db68b1b37fdfa4d7899fa1ba71015b33efb34b (patch)
tree79b34729ab94e427b90f53b4bd8f6cc14e4e5bf5 /astroid/bases.py
parent6a05216f0b924fca7d4c95599e264da7531a5e3e (diff)
downloadastroid-git-01db68b1b37fdfa4d7899fa1ba71015b33efb34b.tar.gz
Create and use ``InferenceResult`` (#1597)
Diffstat (limited to 'astroid/bases.py')
-rw-r--r--astroid/bases.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/astroid/bases.py b/astroid/bases.py
index ef16486a..4e6ac169 100644
--- a/astroid/bases.py
+++ b/astroid/bases.py
@@ -9,6 +9,7 @@ from __future__ import annotations
import collections
import collections.abc
+from collections.abc import Sequence
from typing import TYPE_CHECKING
from astroid import decorators
@@ -25,6 +26,7 @@ from astroid.exceptions import (
InferenceError,
NameInferenceError,
)
+from astroid.typing import InferenceResult
from astroid.util import Uninferable, lazy_descriptor, lazy_import
objectmodel = lazy_import("interpreter.objectmodel")
@@ -120,7 +122,11 @@ class Proxy:
yield self
-def _infer_stmts(stmts, context, frame=None):
+def _infer_stmts(
+ stmts: Sequence[nodes.NodeNG | type[Uninferable] | Instance],
+ context: InferenceContext | None,
+ frame: nodes.NodeNG | Instance | None = None,
+) -> collections.abc.Generator[InferenceResult, None, None]:
"""Return an iterator on statements inferred by each statement in *stmts*."""
inferred = False
if context is not None: