summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2005-11-11 18:18:51 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2005-11-11 18:18:51 (GMT)
commite62e936e797e6f30ee81932abe5a4e5f9f2f6f85 (patch)
treecd548c0e68df1b459ef1ae73e89b3375c7db364f /Lib
parent1cb179e93fb0f698fdb5f215b3864c578d910d9a (diff)
downloadcpython-e62e936e797e6f30ee81932abe5a4e5f9f2f6f85.zip
cpython-e62e936e797e6f30ee81932abe5a4e5f9f2f6f85.tar.gz
cpython-e62e936e797e6f30ee81932abe5a4e5f9f2f6f85.tar.bz2
Change PrettyPrinter.pprint(), so that output is written directly to the
output stream, instead of writing it to a StringIO first and writing the result of this to the output stream. This should speed up the initial output.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/pprint.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pprint.py b/Lib/pprint.py
index da6ab1a..f77a0e2 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -103,7 +103,8 @@ class PrettyPrinter:
self._stream = _sys.stdout
def pprint(self, object):
- self._stream.write(self.pformat(object) + "\n")
+ self._format(object, self._stream, 0, 0, {}, 0)
+ self._stream.write("\n")
def pformat(self, object):
sio = _StringIO()