argument checking before getattr
bt98 at doc.ic.ac.uk
Sat Jan 12 12:02:41 EST 2002
I am trying to extend a C/C++ object with Python, and wrapped the object
into a class.
>From the Python document, the following is used to dispatch a method
call from a Python object (an instance of class foo), to a function in
the C/C++ extension :
I have implemented that. The integration of C/C++, the interface and
Python works perfect.
Instead of doing (hiding) argument checking in the interface, now I am
hoping to do some type checking in Python. The following shows what I am
trying to achieve:
# do some checking on "args"
Instead of return the correct argument, it only returns a trace of the
<built-in method foo_fun of foo object at 0x80ef820>
It doesn't work out. Why? Any comments would be appreciated.
Thanks in advance.
More information about the Python-list