any(), all() and empty iterable

Peter Otten __peter__ at web.de
Sun Apr 12 19:11:25 CEST 2009


John O'Hagan wrote:

> Or to put it another way, if I ask someone "Amongst your books, is one of
> them 'Robinson Crusoe'?", and they don't have any books, they could
> answer 'yes' (or 'no' equally truthfully), but I'd rather they told me
> that no, they don't have  'Robinson Crusoe'.

That's why you ask "Do you have any books called 'Robinson Crusoe'?" rather
than "Are all your books called 'Robinson Crusoe'?".

The difference between logic and natural language is more striking
with "or". When you ask "Do you take the bus at nine or eleven?" you
certainly don't expect "Yes" as the answer.

Peter




More information about the Python-list mailing list