[Python-Dev] Null checking

David Abrahams David Abrahams" <david.abrahams@rcn.com
Mon, 10 Jun 2002 09:33:21 -0400


From: "Tim Peters" <tim.one@comcast.net>

> Different authors.  Guido is omnipotent but not omnipresent <wink>.  It
> would be good (IMO) to expose something like null_error in the public
API,
> to encourage NULL-checking.  I don't know that there's real value in
trying
> to preserve a pre-existing exception, though (if the code is hosed, it's
> hosed).

It depends on whether you intend to make the null checks part of the public
interface. There is a style of programming which says: "write your code
with no error checks, then look at the end to see if something went wrong".
When, as in 'C', you don't have real exception-handling in the language, it
can lead to smaller/more-straightforward code.

-Dave