"for" with "else"?

Stephen Horne $$$$$$$$$$$$$$$$$ at $$$$$$$$$$$$$$$$$$$$.co.uk
Thu Oct 2 09:59:55 EDT 2003


On Thu, 02 Oct 2003 09:26:43 GMT, Alex Martelli <aleax at aleax.it>
wrote:

>They might, *EXCEPT* that "passing a callable" is out of fashion, and
>out of favour, in the BDFL's current opinion -- and for good reasons,
>too, although they MIGHT change in the future.

I agree mostly. At present, first-class functions are very powerful
tools, but they certainly have some drawbacks.

The trouble, as you said, is the syntax. At present, the most natural
syntax happens in list comprehensions - where the language grammar
isolates the 'code block'. It's hard to think of a good syntax which
(1) doesn't recreate lambda to explicitly mark out the 'code block',
and (2) can exist within Pythons existing dynamic model.

:-(


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list