[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2011-07-15 Thread Éric Araujo
Éric Araujo 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 ',\n', because I thi

[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2011-03-08 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.3 -Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2009-09-18 Thread Éric Araujo
Éric Araujo added the comment: And use keyword-only arguments :) -- nosy: +Merwok ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2009-08-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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 ___ Python tracker

[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2009-08-21 Thread Demur Rumed
Demur Rumed 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 ___ Py

[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2009-08-20 Thread Mary Stern
Mary Stern 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( stream=stream,

[issue6743] pprint.pprint should support no objects to print blank lines & allow args

2009-08-20 Thread Mary Stern
New submission from Mary Stern : 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 given)"). A simple im