Python/C++ interface

Michael Hudson mwh21 at cam.ac.uk
Thu Feb 1 16:23:43 EST 2001


Jay O'Connor <joconnor at cybermesa.com> writes:

> Now.  On the C++ side, args is considered, and parsed, as a Tuple. 
> However, what I found was that a Tuple was not being passed, just a
> String.  The only time a Tuple was passed was if there was more than one
> argument.  The whole argument list would be converted to a Tuple, then.

You missed a METH_VARARGS somewhere.

> Is this an error in the documentation?  Or has the passing method
> changed between 1.5.x and 2.0 (I'm using 2.0) and the documentation is
> just out of date?
> 
> Also,  is there a good way of printing the name of the type of a
> PyObject?

Something very like printf(ob->ob_type->tp_name).
Or print type(object).name in Python.

Cheers,
M.

-- 
  For their next act, they'll no doubt be buying a firewall running
  under NT, which makes about as much sense as building a prison out
  of meringue.                                           -- -:Tanuki:-
               -- http://home.xnet.com/~raven/Sysadmin/ASR.Quotes.html



More information about the Python-list mailing list