[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1299956 - /subversion/trunk/subversion/tests/cmdline/svntest/wc.py

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Tue, 13 Mar 2012 08:40:30 -0500

On Tue, Mar 13, 2012 at 12:57 AM, Greg Stein <gstein_at_gmail.com> wrote:
> On Mon, Mar 12, 2012 at 22:21,  <hwright_at_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/
Received on 2012-03-13 14:41:03 CET

This is an archived mail posted to the Subversion Dev mailing list.