[Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

Alex Martelli aleaxit at gmail.com
Fri Aug 7 16:55:44 CEST 2009


2009/8/7 Kristján Valur Jónsson <kristjan at ccpgames.com>:
> Unless I am very much mistaken, this is the approach Ruby takes.
> Everything is an expression.  For example, the value of a block is the value of
> The last expression in the block.
>
> I've never understood the need to have a distinction betwen statements and expressions, not when expressions can have side effects.  It's like that differentce between procedures and functions in pascal that only serves to confuse

If you're interested in understanding it better, research
Query-Command Separation (QCS), e.g. starting at
http://en.wikipedia.org/wiki/Command-query_separation and links
therefrom.


Alex


More information about the Python-Dev mailing list