Operator Precedence/Boolean Logic

Antoon Pardon antoon.pardon at rece.vub.ac.be
Thu Jun 23 04:17:55 EDT 2016

Op 23-06-16 om 09:05 schreef Steven D'Aprano:
> On Thursday 23 June 2016 16:34, Andreas Röhler wrote:
>> Indeed, why should the result of 4 - 4 have a different truth-value than
>> 4 - 3 ?
> Because 4-4 is zero, which is "nothing", while 4-3 is one, which is 
> "something".

No zero is not nothing. If zere is nothing and an empty list is nothing,
I would expect zero to be an empty list or that they could be used interchangebly.

For instance in a project of mine polling for information and
receiving an empty list is different from receiving None. An empty
list means there is currently no information available. None means
The information streams came to an end.

I rarely need tests where any truthy value will branch in one
direction and any falsy value in the other. So IMO it is more
hassle than it is worth.


More information about the Python-list mailing list