[Python-Dev] Null checking

Guido van Rossum guido@python.org
Mon, 10 Jun 2002 09:41:47 -0400

> I'd also like to know why all the (for instance) methods in
> tupleobject.c start with "if (!PyTuple_Check(self)".  You'd have to
> try REALLY hard to get those tests to fail...

I found exactly one call to PyTuple_Check() that satisfies that
description, and it was in your own (uncommitted) addition,
tuplesubscript(). :-)

Note that the PyXxx_Check() macros do *not* check for a NULL pointer
and crash hard if you pass them one.

--Guido van Rossum (home page: http://www.python.org/~guido/)