[Extensions] Checking for type

Gerhard Häring gh_pythonlist at gmx.de
Fri May 31 04:04:03 EDT 2002


Currently, I'm checking for the type with:

    if (function_result->ob_type == &PyInt_Type)

I'd rather use the C-API equivalent of
isinstance(function_result, IntType) but there doesn't seem to be one
that's compatible with Python 2.1, too.

Any suggestions?

Gerhard
-- 
This sig powered by Python!
Außentemperatur in München: 16.4 °C      Wind: 0.5 m/s





More information about the Python-list mailing list