summaryrefslogtreecommitdiff
path: root/astroid/util.py
diff options
context:
space:
mode:
authorBryce Guinta <bryce.guinta@protonmail.com>2020-06-22 02:22:16 -0400
committerGitHub <noreply@github.com>2020-06-22 08:22:16 +0200
commit4b7566b0c8365613198af493d4115d32d7d4c66e (patch)
tree57ab0d0b8f2166ffdff34797c5710f64251142ef /astroid/util.py
parent184b591ec79468d75be03835ee0d6fd12343d93a (diff)
downloadastroid-git-4b7566b0c8365613198af493d4115d32d7d4c66e.tar.gz
Squash one-off inference utility functions to help reduce recursion errors (#804)
This also makes debugging a lot simpler reducing the complexity of the function stack.
Diffstat (limited to 'astroid/util.py')
-rw-r--r--astroid/util.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/astroid/util.py b/astroid/util.py
index 3ab75615..14ec43c6 100644
--- a/astroid/util.py
+++ b/astroid/util.py
@@ -7,7 +7,6 @@
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
import warnings
-from itertools import islice
import importlib
import lazy_object_proxy
@@ -139,26 +138,3 @@ def proxy_alias(alias_name, node_type):
},
)
return proxy(lambda: node_type)
-
-
-def limit_inference(iterator, size):
- """Limit inference amount.
-
- Limit inference amount to help with performance issues with
- exponentially exploding possible results.
-
- :param iterator: Inference generator to limit
- :type iterator: Iterator(NodeNG)
-
- :param size: Maximum mount of nodes yielded plus an
- Uninferable at the end if limit reached
- :type size: int
-
- :yields: A possibly modified generator
- :rtype param: Iterable
- """
- yield from islice(iterator, size)
- has_more = next(iterator, False)
- if has_more is not False:
- yield Uninferable
- return