On Apr 20, 1:05 am, wb <[email protected]> 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 is a
native list. The best way think that you copy (and assign) the
reference value, not the actual data. Just think about lists of lists,
then you have copies of lists where the containing lists are the same
- i.e. you need to deep copy and that might not work uniquely for all
possible objects in lists. Python is rather pragmatic and its behavior
should be as consistent as possible to make things easy. Also,
explicit is better than implicit: b = a[:] !

H

PS: as an easter egg, do "import this" in python.

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to