On Tue, 07 Jun 2011 01:03:55 -0300, Gabriel Genellina wrote:

> En Sat, 28 May 2011 14:05:16 -0300, Steven D'Aprano
> <steve+comp.lang.pyt...@pearwood.info> escribió:
> 
>> On Sat, 28 May 2011 09:39:08 -0700, John Nagle wrote:
>>
>>> Python allows patching code while the code is executing.
>>
>> Can you give an example of what you mean by this?
[...]
> I think John Nagle was thinking about rebinding names:
> 
> 
> def f(self, a, b):
>    while b>0:
>      b = g(b)
>      c = a + b
>      d = self.h(c*3)
>    return "hello world"*d
> 
> both g and self.h may change its meaning from one iteration to the next,
> so a complete name lookup is required at each iteration. This is very
> useful sometimes, but affects performance a lot.

Ah, that was what I was missing.

Thanks Gabriel.


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

Reply via email to