Expression can be simplified on list
Ben Finney
ben+python at benfinney.id.au
Wed Sep 14 00:40:20 EDT 2016
Lawrence D’Oliveiro <lawrencedo99 at gmail.com> writes:
> On Wednesday, September 14, 2016 at 2:25:48 PM UTC+12, Ben Finney wrote:
> > Lawrence D’Oliveiro writes:
> >
> > > It would be better if all such conversions were explicit
> >
> > Why? It's entirely unambiguous: the expression of an ‘if’ statement
> > *can only be* evaluated in a Boolean context. What else could the
> > reader reasonably expect?
>
> <http://lwn.net/Articles/590299/>
That reference supports my position: The only reasonable interpretation
of the expression specified to ‘if‘, is that it is interpreted in a
Boolean context.
The behaviour described there was a bug. Once recognised, it was fixed.
There isn't any other reasonable interpretation of the expression for
‘if’: it's interpreted as a Boolean value.
--
\ “The best mind-altering drug is truth.” —Jane Wagner, via Lily |
`\ Tomlin |
_o__) |
Ben Finney
More information about the Python-list
mailing list