Hello, I have an API like this:
class Foo { public: Foo(char *filename); Foo(char *buffer, int size); [...] }; To make both construction forms work, I have wrapped the second constructor as a staticmethod factory, using /Array/ and /ArraySize/ (this is because overload resolution can't work, as both forms would get a Python string object). The problem is the ownership of the buffer pointer. The C++ Foo API expects the buffer to stay alive for the lifetime of the Foo instance. Is there an immediate way to implement this? I was thining of storing the buffer as Pything string object in a "secret" member of the Foo wrapped instance. Does that sound like a good solution? Thanks -- Giovanni Bajo _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde