changeset 67:e228c35b36c0

Gave default parameter to the pretty-printer
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 27 May 2009 11:35:15 +0200
parents 8b75ba4a3745
children 800d8d768d03
files pysmcl/pretty_print.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/pretty_print.py	Wed May 27 12:00:34 2009 +0200
+++ b/pysmcl/pretty_print.py	Wed May 27 11:35:15 2009 +0200
@@ -5,7 +5,7 @@
 program parsed into the ast.
 """
 
-import ast
+import ast, sys
 
 
 def arguments_string(arguments):
@@ -249,7 +249,7 @@
 class PrettyPrinter(ast.NodeVisitor):
     indent = 0
 
-    def __init__(self, output):
+    def __init__(self, output = sys.stdout):
         self.output = output
 
     def print_body(self, body):
@@ -365,7 +365,7 @@
         self.print_body(node.body)
 
 
-def pprint(module, output):
+def pprint(module, output=sys.stdout):
     """Pretty prints the module represented by the ast node in
     ***module***
     """