Custom Types

Asked by sean ross

I am looking for a better way to write a a custom method wrapper to help me with non standard type conversions.

What I would like to do is write:

>>> SomeClass.add_function_as_method( 'some_function_X', Parameter.new('PyObject*') , [Parameter.new( 'SomeClass*', 'set', transfer_ownership=False)], custom_name='method_X' )

Where I link with a c++ file that defines the function:

    PyObject* some_function_X( SomeClass* something );

Is this possible? I have tried this and I see the following code is generated:

    retval = particle_str(self->obj);
    py_retval = Py_BuildValue((char *) "N", retval);
    return py_retval;

Is there anything similar that I can try?

Question information

Language:
English Edit question
Status:
Solved
For:
PyBindGen Edit question
Assignee:
No assignee Edit question
Solved by:
sean ross
Solved:
Last query:
Last reply:
Revision history for this message
Gustavo Carneiro (gjc) said :
#1

I don't understand your question. What is wrong with the generated code? You got it working or not? It sounds like you're doing the right thing, so I don't know how to help...

Revision history for this message
sean ross (srossross) said :
#2

Sorry, you are correct. My example was causing trouble from an existing error in another part of my code.