Python method callbacks
kFactor
kfactor at my-deja.com
Mon Sep 18 22:27:25 EDT 2000
More information about the Python-list mailing list
Mon Sep 18 22:27:25 EDT 2000
- Previous message (by thread): NULL vs. None and MySQLdb
- Next message (by thread): Newbie trying to understand __name__=='__main__'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all
I'm trying to store and later call from C++ a reference to a method
from a python class instance using the PyEval_CallObject(...) function.
Am I correct in assuming that method objects are already bound to the
specific instance of the python class? i.e. the self argument is
supplied by python automatically when I call the method (via C++)?
The reason I'm asking this is because when I constructed the argument
list with :
arglist = Py_BuildValue("(O)", Self);
result = PyEval_CallObject(PythonCallback, arglist);
where Self is the "self" object of the instance of the class
Python reported :
TypeError: too many arguments; expected 1, got 2
but when I used :
arglist Py_BuildValue("()");
It worked ok.
Thanks In advance.
Kostas
Sent via Deja.com http://www.deja.com/
Before you buy.
- Previous message (by thread): NULL vs. None and MySQLdb
- Next message (by thread): Newbie trying to understand __name__=='__main__'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list