Éric Araujo mer...@netwok.org added the comment:
Here’s a first draft at a patch. I’ve added a module-level print function and
a PrettyPrinter.print method which does the real work.
The functions have a signature compatible with print, but I have changed one
default value: sep defaults to
Changes by Terry J. Reedy tjre...@udel.edu:
--
versions: +Python 3.3 -Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6743
___
___
Éric Araujo mer...@netwok.org added the comment:
And use keyword-only arguments :)
--
nosy: +Merwok
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6743
___
Demur Rumed junkm...@hotmail.com added the comment:
I've included a patched version. I went with using a function signature
of def pprint(*object, stream=None, indent=1, width=80, depth=None)
--
nosy: +serprex
Added file: http://bugs.python.org/file14765/pprint.py
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
Changing the signature of a well-used function is dangerous.
Why not add a function named pprint.print, with the exact same signature
as __builtin__.print?
--
nosy: +amaury.forgeotdarc
___
New submission from Mary Stern maryst...@yahoo.com:
Using print in python 3 I would like to simple replace print with
pprint.pprint. However pprint cannot be called with no arguments, so
this cannot currently be done (the error is TypeError: pprint() takes
at least 1 positional argument (0
Mary Stern maryst...@yahoo.com added the comment:
Sorry: you also need to print out the args! :) .. like this:
def pprint(object='\n', *args, stream=None, indent=1, width=80, depth=None):
Pretty-print a Python object to a stream [default is sys.stdout].
printer = PrettyPrinter(