On Dec 14, 2008, at 4:05 AM, Lars Fischer wrote:

> Hello Giovanni,
>
> you have hit one of my favorite Python Pitfalls: Python does always
> call by value, but sometimes it behaves like call by reference .

Correction, Python *always* does call by reference. Fortunately, most  
basic types (ints, tuples, and most Sage types) are immutable,  
meaning you can't change it so it doesn't matter. Assignment is by  
reference too.

If you want to change something that's passed in, one should consider  
if it's better to change a copy instead. The comments on the copy  
module are relevant here.

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to