On Thu, Apr 17, 2008 at 3:34 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > On 17/04/2008, Robert Kern <[EMAIL PROTECTED]> wrote: > > On Thu, Apr 17, 2008 at 1:21 PM, Eric Firing <[EMAIL PROTECTED]> wrote: > > > Arg! Cancel that! I didn't look carefully enough. How embarrassing! > > > Sorry for the noise. > > > > Don't apologize. That is very odd code. Stefan, is there a reason to > > form a 1-item tuple then do 1-item tuple unpacking everywhere? The > > test works the same after removing the extraneous commas. Anyways, > > I've checked that in. > > This is not necessarily a justification, but many tests construct > tuples of test objects which are then unpacked at the beginning of > every function. This is not unreasonable when multiple objects are > present: > > class TestSomething(NumpyTestCase): > def setUp(self): > A = array([1,2,3]) > B = array([4,5,6]) > self.d = A, B > > def test_something(self): > A, B = self.d > assert_not_equal(A,B) > > It's a little less cumbersome than using self.A and self.B inside each > test case. > > Does it make sense to use a length-1 tuple when there's only one piece > of test data, just for consistency?
I don't think so. A trailing comma is too easy to miss and looks like an error when it isn't missed. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion