[capi-sig] Extension Problem

Ali Alhakim alika at spray.se
Tue Aug 14 23:54:28 CEST 2007


Thank you Mark. That is exactly what my problem was.If the example included parsed integer and/or float (double) variables it would be much desriptive
 
On Tue, 14 Aug 2007 23:44:02 +0200, Mark Hammond <mhammond at skippinet.com.au> wrote:
 
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
 
 
__________ NOD32 2460 (20070814) Information __________
 
This message was checked by NOD32 antivirus system.
http://www.eset.com
 
 
 


 

Gå in och titta på nätets roligaste filmer just nu eller ladda upp ditt eget bidrag på Spray Crazy. http://crazy.spray.se/


More information about the capi-sig mailing list