summaryrefslogtreecommitdiff
path: root/astroid/as_string.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2020-03-10 10:33:35 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2020-03-10 10:33:35 +0100
commit77e205dc64ead82e38bb901e08117ef6f6162c5c (patch)
tree8fbd409badeee2ed517ba368ee521a790c0f28fd /astroid/as_string.py
parent00bcf7b817ed459ee617b8af8843aca18d72fe04 (diff)
downloadastroid-git-77e205dc64ead82e38bb901e08117ef6f6162c5c.tar.gz
Add a new EvaluatedObject container
This container is used to store values that have already been evaluated. For instance, 79d5a3a783cf0b5a729e4e467508e955a0cca55f added support for inferring `tuple()` call arguments, but as a result, the `elts` of a `Tuple` can be objects not *references*. As a result, `Tuple.elts` can contain class objects rather than references (names) to class object. The `EvaluatedObject` helps with that, as we still have to call `.infer()` (albeit a no-op) to grab the inferred value of an element.
Diffstat (limited to 'astroid/as_string.py')
-rw-r--r--astroid/as_string.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/astroid/as_string.py b/astroid/as_string.py
index 84038ba3..da677a79 100644
--- a/astroid/as_string.py
+++ b/astroid/as_string.py
@@ -608,6 +608,9 @@ class AsStringVisitor:
def visit_property(self, node):
return node.function.accept(self)
+ def visit_evaluatedobject(self, node):
+ return node.original.accept(self)
+
def _import_string(names):
"""return a list of (name, asname) formatted as a string"""