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

Re: svn commit: r19318 - trunk/subversion/tests/cmdline/svntest

From: Michael Haggerty <mhagger_at_alum.mit.edu>
Date: 2006-04-26 11:10:49 CEST

Peter Samuelson wrote:
> [mhagger@tigris.org]
>
>>- return not self.test_case.convert_result(result)
>>+ return {0:1, 1:0, 2:2}[self.test_case.convert_result(result)]
>
> return (1,0,2)[self.test_case.convert_result(result)]

I considered your variant, but thought that the dictionary variant makes
the code's intention clearer. It also produces a clear error if
convert_result() should accidentally return a value in (-3, -2, -1).

Also, I plan to introduce symbolic contants for 0, 1, and 2, after which
the tuple version would be quite obscure :-)

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 26 11:11:25 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.