Hey Gang, I have come across the need to pass both keywords and arguments
from one function to another. The keywords are passing just fine with a
PyObjectCall command. However, if the user does not specify any keywords at
the interpretor, the command will seg-fault.
The docs state that keywords argument can be NULL, but this does not work
with NULL set objects.
How do I build a keywords dictionary which can function correctly if there
are none to start with or if the user defined some? I am thinking it can
be done with a PyDict() like command?
The below snippet is the scenario I am trying to achieve -->
if ( kwds ) {
self->c_surface = PyObject_Call((PyObject *) &PyMyObject_Type,
object_args, kwds); }
else { self->c_surface = PyObject_Call((PyObject *) &PyMyObject_Type,
object_args, NULL); }
--
Bust0ut, Surgemcgee: Systems Engineer ---
surgemcgee.com
Django_Teamplate3d
AFAIK there isn't,
if you wanted to avoid parsing it you could replace 's' with 'O' so at
least its type won't be checked.
On Wed, Nov 7, 2012 at 12:21 PM, Robert Steckroth
<robertsteckroth(a)gmail.com> wrote:
> Hello Gang, I was wondering about a better way to accept dummy arguments in
> a object.
> *PyArg_ParseTuple(args, "|ssi", &meh, &path, &font_size) )*
>
> I would like to omit the* meh variable for a null pointer instead like this.
> *
> *PyArg_ParseTuple(args, "|ssi", NULL, &path, &font_size) )*
>
> This become necessary when args are passing from one object to another with
> Py_Tuple creations.
>
>
> Any thoughts?
>
>
> --
> Bust0ut, Surgemcgee: Systems Engineer ---
> surgemcgee.com
> Django_Teamplate3d
> _______________________________________________
> capi-sig mailing list
> capi-sig(a)python.org
> http://mail.python.org/mailman/listinfo/capi-sig
--
- Campbell
Hello Gang, I was wondering about a better way to accept dummy arguments in
a object.
*PyArg_ParseTuple(args, "|ssi", &meh, &path, &font_size) )*
I would like to omit the* meh variable for a null pointer instead like this.
*
*PyArg_ParseTuple(args, "|ssi", NULL, &path, &font_size) )*
This become necessary when args are passing from one object to another with
Py_Tuple creations.
Any thoughts?
--
Bust0ut, Surgemcgee: Systems Engineer ---
surgemcgee.com
Django_Teamplate3d