[docs] [issue23153] Clarify Boolean Clause Results

Josh Rosenberg report at bugs.python.org
Sat Jan 3 01:12:33 CET 2015


Josh Rosenberg added the comment:

A few questions/comments:

1. How would the reference clarify matters?

2. "Most languages" is perhaps overstating the matter. Lower level languages and strictly typed languages tend to return a boolean value, but many high level scripting languages (among them Perl, Python and JavaScript) return the last value evaluated.

3. Referencing the bool() constructor doesn't seem like it would add much, and might encourage the wrong behaviors; idiomatic Python rarely bothers to coerce to True/False because it's unnecessary extra work when an if or while condition can simply evaluate the "truthiness" of the value being tested without coercion. I kind of like the fact that it omits use of bool(), because down that road lies madness (if bool(a or b) == False: madness).

----------
nosy: +josh.r

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23153>
_______________________________________


More information about the docs mailing list