summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--astroid/manager.py3
-rw-r--r--astroid/node_classes.py2
-rw-r--r--astroid/tests/unittest_inference.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 211fbb75..615795de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -160,8 +160,9 @@ Release Date: Unknown
* Limit the maximum amount of interable result in an NodeNG.infer() call to
100 by default for performance issues with variables with large amounts of
possible values.
- The max inferable value can be tuned by setting the ASTROID_MAX_INFERABLE environment
- variable at start up.
+
+ The max inferable value can be tuned by setting the `max_inferable_values` flag on
+ astroid.MANAGER.
What's New in astroid 1.6.0?
diff --git a/astroid/manager.py b/astroid/manager.py
index c7553661..63da62ba 100644
--- a/astroid/manager.py
+++ b/astroid/manager.py
@@ -52,8 +52,7 @@ class AstroidManager:
# Export these APIs for convenience
self.register_transform = self._transform.register_transform
self.unregister_transform = self._transform.unregister_transform
- self.max_inferable = int(
- os.environ.get("ASTROID_MAX_INFERABLE", 100))
+ self.max_inferable_values = 100
def visit_transforms(self, node):
"""Visit the transforms and apply them to the given *node*."""
diff --git a/astroid/node_classes.py b/astroid/node_classes.py
index a3c02fcf..4871f519 100644
--- a/astroid/node_classes.py
+++ b/astroid/node_classes.py
@@ -325,7 +325,7 @@ class NodeNG:
gen = context.cache_generator(
key, self._infer(context, **kwargs))
- return util.limit_inference(gen, MANAGER.max_inferable)
+ return util.limit_inference(gen, MANAGER.max_inferable_values)
def _repr_name(self):
"""Get a name for nice representation.
diff --git a/astroid/tests/unittest_inference.py b/astroid/tests/unittest_inference.py
index 5f9194c3..e31d19a9 100644
--- a/astroid/tests/unittest_inference.py
+++ b/astroid/tests/unittest_inference.py
@@ -4678,7 +4678,7 @@ def test_limit_inference_result_amount():
"""
result = extract_node(code).inferred()
assert len(result) == 16
- with patch('astroid.node_classes.MANAGER.max_inferable', 4):
+ with patch('astroid.node_classes.MANAGER.max_inferable_values', 4):
result_limited = extract_node(code).inferred()
# Can't guarentee exact size
assert len(result_limited) < 16