This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jpotelle
Recipients docs@python, ethan.furman, josh.r, jpotelle, r.david.murray
Date 2015-01-03.16:00:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1420300838.61.0.821864153413.issue23153@psf.upfronthosting.co.za>
In-reply-to
Content
I'm learning Python and informing you this is confusing - and you close the ticket without hearing any response to your questions?

Re: Josh
1. To show how to return a Boolean result from a Boolean clause. If there's a better way, I'm all for it.
2. "Most" is a generalization. Perhaps "Many" is a better term? All traditional 3GLs and some other scripting languages don't; e.g. REXX and Beanshell return Boolean. But it's not important here. 
3. As I said, "or some better method". I've been programming 30 years but am only now learning Python. All I asking for is better clarification in the tutorial. If this were a wiki I would add one myself.

Re: Ethan; quote from the line above, same section in the Tutorial:
"When used as a general value and not as a Boolean, the return value of a short-circuit operator is the last evaluated argument." If this isn't correct, please fix it. And this whole sentence is a bit weird to me - Boolean operators are *always* used in a Boolean context - unless the op is overloaded with some other functionality. Why would it return anything else? (well let's not go there...)

Re: R.David
Sorry I didn't see any input from "Joel". But, yes, this is a tutorial.

I argue that using A = (B or C or D) construct is not good, intuitive programming style, anyway. To me this looks like A should hold a Boolean, even only from a pseduocode standpoint. Even so, one wouldn't need to "cast" a Boolean if a Boolean was returned, as old programmers like me would expect. 

But, OK, so don't use bool() - but what you said is basically what I'm looking for IN the tutorial - eduction about why a Boolean should NOT be expected. Or how to achieve a Boolean, since it's a valid data type since version 2.3. This is a tutorial, after all.

For example, the full documentation for v3.4 section 4.1: "Operations and built-in functions that have a Boolean result always return 0 or False for false and 1 or True for true, unless otherwise stated. (Important exception: the Boolean operations or and and always return one of their operands.)". Even here the docs says this is an "exception".
History
Date User Action Args
2015-01-03 16:00:38jpotellesetrecipients: + jpotelle, r.david.murray, docs@python, ethan.furman, josh.r
2015-01-03 16:00:38jpotellesetmessageid: <1420300838.61.0.821864153413.issue23153@psf.upfronthosting.co.za>
2015-01-03 16:00:38jpotellelinkissue23153 messages
2015-01-03 16:00:35jpotellecreate