[Python-bugs-list] [ python-Bugs-505152 ] pprint should (optionally) use str

noreply@sourceforge.net noreply@sourceforge.net
Mon, 01 Apr 2002 21:08:48 -0800


Bugs item #505152, was opened at 2002-01-17 18:15
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=505152&group_id=5470

Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Barry Warsaw (bwarsaw)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: pprint should (optionally) use str

Initial Comment:
pprint.pprint() uses repr to display an object. 
However I think it's at least as likely that pretty
printing would be used as a human debugging tool rather
than for generating a string "which can be used as
input to the interpreter".

pprint.pprint() -- and PrettyPrinter.pprint() should
optionally use str() to print a human readable
representation of the object.


----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-04-02 00:08

Message:
Logged In: YES 
user_id=3066

The usefulness of str() seems questionable; if the issue is
debugging, repr()-like presentation seems to make more
sense.  I do think the pretty-printer should be configurable
(via subclassing at least).

I've checked in an attempt to make it easier to change the
machinery use, but I'm not sure this is really the right change.

I'm closing the bug report as vague, but am interested in
suggestions for improving the pprint module.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=505152&group_id=5470