On Tue, 29 Jul 2008 21:15:12 +0100, Matthew Woodcraft wrote:

> Steven D'Aprano  <[EMAIL PROTECTED]> 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).

Sure. The way I'd handle that is test for None at the start of the 
function, and raise an error there, rather than deal with it at some 
arbitrary part of the function body.


-- 
Steven
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to