Re: CVS update: subversion/subversion/tests/clients/cmdline svn_output.py
From: Greg Stein <gstein_at_lyra.org>
Date: 2001-04-13 12:21:03 CEST
On Thu, Apr 12, 2001 at 11:59:30PM -0000, email@example.com wrote:
That doesn't copy the lists. Names are simply references to objects. The
struct some_object *expected_lines;
elist = expected_lines;
You're just copying pointers, not making copies.
Easiest way to copy a list is to take a slice of the whole list:
elist = expected_lines[:]
The "copy" module can copy just about anything, but no need to pull that in
Not that performance matters, but I tend to do assignments one per line,
temp_tuple = make_a_tuple(expected_lines, actual_lines)
For swapping variables, the multiple assignment is perfect:
a, b = b, a
It is clear, and the actual behavior works as expected.
But for assigning stuff to variables... I like one per line, unless you're
a = b = 5
> + for eline in elist:
alist.remove(aline) is easier.
-- Greg Stein, http://www.lyra.org/Received on Sat Oct 21 14:36:28 2006
This is an archived mail posted to the Subversion Dev mailing list.