A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-August/091102.html below:

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

[Python-Dev] statement vs expression [was: (try-except) conditional expression similar to (if-else) conditional (PEP 308)] [Python-Dev] statement vs expression [was: (try-except) conditional expression similar to (if-else) conditional (PEP 308)]Jim Jewett jimjjewett at gmail.com
Mon Aug 10 02:55:12 CEST 2009
> Kristján Valur Jónsson wrote:
>> I've never understood the need to have a distinction betwen statements
>>  and expressions, not when expressions can have side effects.

Alex Martelli responded:
> 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

Either you missed Kristján's point, or your answer was so
subtle that I missed yours.

QCS makes it easy to determine which pieces of code
(queries) are free of side-effects.  I see value in that
for both debugging and optimization.

What I don't see is how that relates to expressions vs
statements **when expressions can have side effects.**

(Actually, in Python, I would say that statements are far
*more* likely to be free of side-effects, as they are often
there for flow control.)

-jJ
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4