diff options
| author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-08-16 14:58:01 +0200 |
|---|---|---|
| committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-08-16 22:24:46 +0200 |
| commit | e839f57649406204fc8e72f39d939652d75eb2e5 (patch) | |
| tree | 7b55a0284e21184b9fc54b0b5033ba46b000d4b7 | |
| parent | 2a767fbebf5102b8da155e673ef9fa38525fd325 (diff) | |
| download | astroid-git-e839f57649406204fc8e72f39d939652d75eb2e5.tar.gz | |
Make 4 spaces the default indent for AsStringVisitor
| -rw-r--r-- | astroid/nodes/as_string.py | 2 | ||||
| -rw-r--r-- | astroid/nodes/node_ng.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/astroid/nodes/as_string.py b/astroid/nodes/as_string.py index 5e33e96b..252605a3 100644 --- a/astroid/nodes/as_string.py +++ b/astroid/nodes/as_string.py @@ -47,7 +47,7 @@ DOC_NEWLINE = "\0" class AsStringVisitor: """Visitor to render an Astroid node as a valid python code string""" - def __init__(self, indent): + def __init__(self, indent=" "): self.indent = indent def __call__(self, node): diff --git a/astroid/nodes/node_ng.py b/astroid/nodes/node_ng.py index 207954a5..761b2800 100644 --- a/astroid/nodes/node_ng.py +++ b/astroid/nodes/node_ng.py @@ -499,7 +499,7 @@ class NodeNG: def as_string(self) -> str: """Get the source code that this node represents.""" - return AsStringVisitor(" ")(self) + return AsStringVisitor()(self) def repr_tree( self, |
