Message91774
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 improvement is to allow no object to be passed in and pprint
would then print a newline rather than fail.
Another problem is that if you try this:
print('hello', True)
and replace print with print, the second arg gets interpreted as the
"stream" parameter.
Both of the above can be fixed (I think) by changing pprint.py as follows:
instead of the current code:
def pprint(object, stream=None, indent=1, width=80, depth=None):
change to this:
def pprint(object='\n', *args, stream=None, indent=1, width=80, depth=None) |
|
Date |
User |
Action |
Args |
2009-08-20 14:21:07 | marystern | set | recipients:
+ marystern |
2009-08-20 14:21:06 | marystern | set | messageid: <1250778066.89.0.880851114314.issue6743@psf.upfronthosting.co.za> |
2009-08-20 14:21:05 | marystern | link | issue6743 messages |
2009-08-20 14:21:05 | marystern | create | |
|