mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
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.
This commit is contained in:
parent
1cb179e93f
commit
e62e936e79
1 changed files with 2 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue