I've been away for a while and just read through the PEP 340 discussion with growing amazement.
Pierre Barbier de Reuille wrote: > As far as I understand it, > iterator-for-blocks and iterator-for-loops are two different beasts. Right! > To try being as clear as possible, I would say the iterator-for-loops > are simplified iterator-for-blocks. IOW, if I were to put them in a > class inheritance hierarchy (I don't say we should put them into one ;) > ) iterator-for-block would be the base class of iterator-for-loop. > Thus, > as for-loops require an iterator-for-loop, they would raise an error if > used with an iterator-for-block. But as blocks require an > iterator-for-blocks they will allow iterator-for-loops too ! IMHO It is more like round holes and square pegs (or the other way around). What PEP 340 seems to be trying to achieve is a generic mechanism to define templates with holes/place holders for blocks of code. That gives two nouns ('template' and 'code block') that both qualify as indicators of reusable items. We can use standard functions as reusable code blocks. Wouldn't a template then be just a function that takes other functions ar arguments? All information transfer between the template and its arguments is via the parameter list/returned values. What am I missing? --eric _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com