[Python-Dev] Re: anonymous blocks

Guido van Rossum gvanrossum at gmail.com
Fri Apr 29 07:18:58 CEST 2005


> If the use of block-statements becomes common for certain
> tasks such as opening files, it seems to me that people are
> going to encounter their use around about the same time
> they encounter for-statements. We need *something* to
> tell these people to enable them to understand the code
> they're reading.
> 
> Maybe it would be sufficient just to explain the meanings
> of those particular uses, and leave the full general
> explanation as an advanced topic.

Right. The block statement is a bit like a chameleon: it adapts its
meaning to the generator you supply. (Or maybe it's like a sewer: what
you get out of it depends on what you put into it. :-)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list