[Python-Dev] Anonymous blocks: Thunks or iterators?

Simon Percivall s.percivall at chello.se
Sat Apr 30 01:44:38 CEST 2005

On 29 apr 2005, at 20.10, Brian Sabbey wrote:
> [...] The thunk and its surrounding function can share the same  
> code.  The thunk gets compiled into the function the same way the  
> body of a for loop would.

This seems really, truly, nasty! Wouldn't this require you to check  
the source code of the function
you want to integrate your thunk into to avoid namespace collisions?  
Well, no, not to avoid
collisions I guess, if it's truly regarded as part of the function.  
But this means it would use the
function's global namespace, etc. You'd be unable to use anything  
from the scopes in which the
thunk is defined, which makes it really, really ... wierd. Or have I  
not gotten it?


More information about the Python-Dev mailing list