Nested function scope problem

Gerhard Fiedler gelists at gmail.com
Thu Jul 27 20:48:11 EDT 2006


On 2006-07-27 17:10:55, Bruno Desthuilliers wrote:

>> Isn't being on the LHS the only way to write to a non-mutable object? 
> 
> You *don't* "write to a non-mutable object". You rebind the name to 
> another object (mutable or not, that's not the problem).

Ok, sloppy writing (sloppy thinking, or probably incomplete understanding
:) on my part. Let me rephrase the three original questions:

>> Isn't being on the LHS the only way to write to a non-mutable object? Are
>> there situations where binding happens without writing to a variable? Are
>> there write accesses to non-mutable objects where the name is not on the
>> LHS?

Rephrased as:

Isn't being on the LHS (of an assignment) the only way to (re)bind a
variable?  Are there situations where binding happens without an explicit
assignment with the variable name being on the LHS?  Can the object
referenced by a variable name get changed without the variable name
appearing on the LHS?

(I hope I got this right now... asking the correct questions is not so easy
sometimes :)

Thanks,
Gerhard




More information about the Python-list mailing list