MYOBJ->ob_type->tp_name - in a C extension?

Randall Hopper aa8vb at yahoo.com
Tue Oct 12 14:16:13 EDT 1999


     Poking around inside of a Python object has me wondering if there
isn't a better way.

    PyErr_Format( PyExc_TypeError, 
                  "argument 'host': expected None or string, %s found",
                  $source == Py_None ? "None" : $source->ob_type->tp_name );
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^

Darned if I can find the query interface though.

Thanks,

Randall




More information about the Python-list mailing list