Operator Precedence/Boolean Logic

Antoon Pardon antoon.pardon at rece.vub.ac.be
Thu Jun 23 05:23:58 EDT 2016


Op 23-06-16 om 10:48 schreef Steven D'Aprano:
> On Thursday 23 June 2016 18:17, Antoon Pardon wrote:
>
>> No zero is not nothing.
> I think you have just disagreed with about four thousand years of 
> mathematicians and accountants.

I don't care. In modern mathematics, zero is usaly defined as the
empty set. The empty set contains nothing, but it isn't nothing
itself. Otherwise the empty set would be the same as the set
containing the empty set, since they both would contain the same,
being nothing.

So modern mathematics seems to agree with me and that is enough
for me.

>> 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.
> You must have real trouble with statically typed languages then. Some of them 
> won't even let you add 0.0 + 1 (since 0.0 is a float and 1 is an int).

Your conclusion is a non sequitur.
 

>> For instance in a project of mine polling for information and
>> receiving an empty list is different from receiving None.
> Okay. How is this relevant to the question of bools? If Python had "real bools" 
> (in, say, the Pascal sense) you would still need to distinguish None from an 
> empty list:

It illustrates the distinction python makes into truthy and falsy, is often
enough inadequate.

A language with real bools would force you to write out the actual expression
you want and wouldn't tempt you to write something you think will work out
fine.

The zen of python states that explicit is better than implicit, but the
"boolean" semantics of python seem to encourage people to rely on a
lot of implicit things that are going on.

-- 
Antoon Pardon.




More information about the Python-list mailing list