On Tue, Mar 13, 2012 at 12:57 AM, Greg Stein <gst...@gmail.com> wrote:
> On Mon, Mar 12, 2012 at 22:21,  <hwri...@apache.org> wrote:
>> Author: hwright
>> Date: Tue Mar 13 02:21:36 2012
>> New Revision: 1299956
>>
>> URL: http://svn.apache.org/viewvc?rev=1299956&view=rev
>> Log:
>> Fix pretty-printing of some datastructures broken in r1299950.
>>
>> It turns out that we have a few datastructures with pprint() methods in the
>> Python test suite, which don't really interface with the pprint module, 
>> although
>> they sound like they should.
>
> I don't understand how .pformat() is different from pprint'ing to a
> stream. What was the underlying cause?

.pformat() isn't itself different from pprint'ing to a stream when
using the module.

What happened here is that we defined some pprint() methods on our own
classes, which took an optional stream argument to which to write.
These methods aren't used by the pprint module in any way, they just
happened to be (confusingly) named the same.

The the underlying cause then was that by using pprint.pformat(), we
weren't getting any of the custom pretty-printing for nodes and trees
that we've all come to know and expect.

-Hyrum



-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/

Reply via email to