[Tutor] Python Book Recommendations [Was:[Re: Security]]

Kent Johnson kent37 at tds.net
Fri Aug 17 04:01:34 CEST 2007


wesley chun wrote:
> that's great clarification... you are right on.  memory references (as
> in C) are different from object references in Python, and yes, it's
> the object references that are passed and up to the object's
> mutability on whether assignment to that object is possible.

As long as I'm nitpicking...well, I guess I don't know what you mean by 
assignment to an object. Assignment is to names, not objects. There is 
nothing you can do in a function to bind a new object to a name in the 
caller. (Well, maybe some deep hackery with stack frames but nothing you 
can do in normal code.) If the passed object is mutable you can change 
its value and the caller will see the new value, but it is still the 
same object.

Wesley I have no doubt you understand this, I'm just trying to be 
careful with the language because people are listening...

Kent


More information about the Tutor mailing list