Type checking inside a C extension

Andrew MacIntyre andymac at bullseye.apana.org.au
Mon Apr 5 06:44:08 EDT 2004


On Mon, 5 Apr 2004, Jon Perez wrote:

> Is there a less expensive way to check the type, or somehow
> avoid a crashing situation (i.e. an exception gets properly raised)
> without calling PyLong_Check() and PyString_Check() the elements
> of each and every tuple?

It might be expensive, but perhaps PyArg_ParseTuple() might be able to do
the decoding of your tuples more neatly than the various PyXX_Check()
calls.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen  ACT  2616
Web:    http://www.andymac.org/               |        Australia




More information about the Python-list mailing list