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/2005-September/056557.html below:

[Python-Dev] "and" and "or" operators in Py3.0

[Python-Dev] "and" and "or" operators in Py3.0 [Python-Dev] "and" and "or" operators in Py3.0Brett Cannon bcannon at gmail.com
Tue Sep 20 20:28:48 CEST 2005
On 9/20/05, Michael Hudson <mwh at python.net> wrote:
[SNIP]
> I _like_ the explanation of 'and' and 'or' as they are now.  They are
> basically control flow constructs -- and have to be to get
> short-circuiting to work -- and adding a coercion to bool at the end
> seems to add complexity, not reduce it (on some levels, anyway).
> 

If you change the definition of 'and' and 'or' to be boolean
comparison operators (as Raymond is proposing) and not as control flow
constructs then is it really that complicated?  I think it would
actually simplify things very slightly since you just say a boolean is
returned instead of the last executed expression by the operator.

> > P.S.  Simplifying "and" and "or" may create a need to introduce a
> > conditional operator but that is a discussion for another day.
> 
> ... which was in the past, I thought.

It was, but changing 'and' and 'or' does tweak the usefulness of a
conditional operator.

-Brett
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