any(), all() and empty iterable

Carl Banks pavlovevidence at
Tue Apr 14 16:36:59 CEST 2009

On Apr 12, 10:45 am, Tim Chase <python.l... at> wrote:
> > That's why you ask "Do you have any books called 'Robinson Crusoe'?" rather
> > than "Are all your books called 'Robinson Crusoe'?".
> Mu.  If I don't have any books..."Have you stopped beating all
> your wives?"  The question makes the presumption that I have
> books (or that you've been beating your wife).

A previous time we had this dicussion, I pointed out that natural
language comparisons are questionable since in natural langauge you
are not confined to two answers.  The valid answer to the above
question could be "I don't have any books", neither yes nor no.  The
closest thing to that you can get in Python is to raise an exception.

Carl Banks

More information about the Python-list mailing list