Boolean tests [was Re: Attack a sacred Python Cow]
Matthew Woodcraft
mattheww at chiark.greenend.org.uk
Tue Jul 29 16:15:12 EDT 2008
Steven D'Aprano <steven at REMOVE.THIS.cybersource.com.au> wrote:
> "if x" is completely type agnostic. You can pass an object of any type to
> it, and it will work. (Excluding objects with buggy methods, naturally.)
There are many circumstances where if a parameter is None I'd rather
get an exception than have the code carry on with the 'empty container'
branch (and silently give me a meaningless result).
-M-
More information about the Python-list
mailing list