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/056540.html below:

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

[Python-Dev] "and" and "or" operators in Py3.0Gareth McCaughan gmccaughan at synaptics-uk.com
Tue Sep 20 13:16:53 CEST 2005
On Tuesday 2005-09-20 11:40, Raymond Hettinger wrote:
> > > 2) When going back and forth between languages, it is easy to forget
> > > that only Python returns something other than a boolean.
> > 
> > As others point out, this isn't true.
> 
> In C, C++, C#, Java, and JavaScript, what do you get when you print the
> result of 3 || 10?

JavaScript does the same as Python, according to section 11.11 of
the EMCA standard as of December 1999, which is what I have to hand.

The others you mention don't, because doing so would fit very
uncomfortably with their static type systems.

Those are not the only languages that exist other than Python.
Perl and Ruby both have Python-like behaviour in this respect.
So do all the Lisp variants I can readily check (CL, elisp,
Scheme, Dylan). So does Lua.

I can't, offhand, think of any dynamically typed language that
doesn't behave this way. Oh, except Smalltalk, which has a
radically different approach to the whole business.

-- 
g

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