On Apr 20, 1:05 am, wb torree...@yahoo.com wrote:
Turning this around: is there a 'list-like' data type in sage which
has 'true' assignment, i.e. copying all its content ?
That's actually a python question. I think it would be rather
confusing if the assignments would change, especially if it
that makes sense - I guess I was expecting lists to behave like list
*classes* which have an overloaded assignment operator.
Turning this around: is there a 'list-like' data type in sage which
has 'true' assignment, i.e. copying all its content
The module copy allows you to make a real copy as
On Apr 19, 2010, at 4:05 PM, wb wrote:
On Apr 20, 12:25 am, Robert Bradshaw rober...@math.washington.edu
wrote:
On Apr 19, 2010, at 2:50 PM, wb wrote:
coming from C I'm confused about this behavior in assignment:
Since you know C, it may make sense to think of lists as being
similar
to
Here is the way that I do this when I want copy vs reference for
lists.
a = [1,2]
b = a[:]
b[0] = a[0] + b[0]
b
[2, 2]
a
[1, 2]
the a[:] does a copy of the list while a=b creates a reference. It is
a little hard to get used to at first.
On Apr 19, 2:50 pm, wb torree...@yahoo.com wrote:
On Apr 20, 12:25 am, Robert Bradshaw rober...@math.washington.edu
wrote:
On Apr 19, 2010, at 2:50 PM, wb wrote:
coming from C I'm confused about this behavior in assignment:
Since you know C, it may make sense to think of lists as being similar
to pointers.
that makes sense - I guess