diff options
| author | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-02 10:25:07 +0100 |
|---|---|---|
| committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-02 10:25:07 +0100 |
| commit | 15e9c4e353f7bb7c4d1df6b4aaefa0d6156e4943 (patch) | |
| tree | e95ff21a659cfa50235a43426c1a3ccbd64f4dfa /as_string.py | |
| parent | 7b9e7036a4577a6538096d517b081cf060ae78f6 (diff) | |
| download | astroid-git-15e9c4e353f7bb7c4d1df6b4aaefa0d6156e4943.tar.gz | |
python2.7: test and fix as_string methods
Diffstat (limited to 'as_string.py')
| -rw-r--r-- | as_string.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/as_string.py b/as_string.py index 76051111..d9b53dfe 100644 --- a/as_string.py +++ b/as_string.py @@ -173,7 +173,7 @@ class AsStringVisitor(ASTVisitor): def visit_dictcomp(self, node): """return an astng.DictComp node as string""" - return '[%s: %s %s]' % (node.key.accept(self), node.value.accept(self), + return '{%s: %s %s}' % (node.key.accept(self), node.value.accept(self), ' '.join([n.accept(self) for n in node.generators])) def visit_discard(self, node): @@ -333,7 +333,7 @@ class AsStringVisitor(ASTVisitor): def visit_setcomp(self, node): """return an astng.SetComp node as string""" - return '[%s %s]' % (node.elt.accept(self), ' '.join([n.accept(self) + return '{%s %s}' % (node.elt.accept(self), ' '.join([n.accept(self) for n in node.generators])) def visit_slice(self, node): |
