[C++-sig] pyste question

Andrew Sutton asutton at cs.kent.edu
Fri Aug 20 04:50:40 CEST 2004

hi... pyste noob here.

i'm building some python interfaces for a library i've written and i'm trying 
to make the exposed python classes as "python-friendly" as possible (like 
nice iteration support). to do this, i'm trying to inject methods into my 
classes using add_method(). unfortunately, pyste is not finding the methods 
i'm requesting to be added.  it seems to be related to the fact that the 
methods i'm having pyste add to the class aren't located in the same header 
file as the class. for example:

class list {

iterator list_iterator();

List = Class("list", "list.hpp")
ListIterator = Function("list_iterator, "list_iterator.hpp")
add_method(List, "list_iterator", "__iter__")

or something very similar to that. it seems that the behavior of add_method 
only looks for methods defined in the file with the class - because this 
doesn't work with includes or added code either - quite frustrating.

am i going about this completely wrong? any help would be appreciated. thanks 
in advance.

andrew sutton
asutton at cs.kent.edu

More information about the Cplusplus-sig mailing list