Mike Meyer wrote:
> Ernst Noch <[EMAIL PROTECTED]> writes:
> 
>>Maybe next time showing something like the following trivial snippet
>>might help demonstrate that the core of the matter doesn't is not the
>>way python treats parameters?
> 
> 
> Did you insert an extra "doesn't" in that? If so, then I agree about
> what isn't the core of the matter.

Uhm, yes. Seems the whole message was written too hastily.

> 
> On the other hand, the snippet doesn't help without an
> explanation. Especially with misleading comments.

Absolutely, it was mainly meant as an example to demonstrate in practice 
that the way python passes parameters has nothing to do with what happens.

> 
> 
>>>>>def func(param, what):
>>
>>      if what:
>>              param['foo'] = 'changed'
>>      else:
>>              temp = param['foo'] # temp is _not_ a reference!
> 
> 
> Except temp *is* a reference. What it's not is a reference to
> param['foo']. Instead, it's a reference to the same object that
> param['foo'] is a reference to.
> 

Oh dear, yes. I inserted that comment as an afterthought.




-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to