Expression can be simplified on list

Chris Angelico rosuav at gmail.com
Tue Sep 13 23:58:41 EDT 2016


On Wed, Sep 14, 2016 at 12:25 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Lawrence D’Oliveiro <lawrencedo99 at gmail.com> writes:
>
>> On Tuesday, September 13, 2016 at 2:33:40 PM UTC+12, Ned Batchelder wrote:
>> > Why do you object to the type conversion to bool?
>>
>> 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?

Error: Logical value not 0 or 1

That's what REXX would say if you used anything else in a boolean
context. Improvement? You be the judge.

ChrisA



More information about the Python-list mailing list