[sage-support] Re: list vs. integer instances

2010-04-20 Thread Harald Schilly
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

Re: [sage-support] Re: list vs. integer instances

2010-04-20 Thread Laurent
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

Re: [sage-support] Re: list vs. integer instances

2010-04-20 Thread Robert Bradshaw
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

[sage-support] Re: list vs. integer instances

2010-04-19 Thread D. Monarres
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:

[sage-support] Re: list vs. integer instances

2010-04-19 Thread wb
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