[capi-sig] Extension Problem

Mark Hammond mhammond at skippinet.com.au
Tue Aug 14 23:44:02 CEST 2007


In an attempt to redeem my previous blindness:
 
> Thank you Anthony and Joe. I thought that all arguments 
> should be passed into pointers.

By passing the address of a double, you *are* passing a pointer.

> The introductary example in 
> the python reference documentation about Python extension 
> confused me. I hope that the mentioned example will be 
> changed to something simpler.

Which specific example did you find confusing?  I'm guessing the 'spam'
example at http://docs.python.org/ext/simpleExample.html, as it does:

    const char *command;
    int sts;

    if (!PyArg_ParseTuple(args, "s", &command))
        return NULL;

and strings are somewhat "special", in that a pointer is the "native" type
of a string, so a pointer to a pointer is indeed what is passed.  If that
example also parsed an integer it might have made things a little clearer...

Cheers,

Mark



More information about the capi-sig mailing list