embedding python and new-style classes

Stephen Horne $$$$$$$$$$$$$$$$$ at $$$$$$$$$$$$$$$$$$$$.co.uk
Mon Sep 29 14:35:42 EDT 2003


On Mon, 29 Sep 2003 13:28:13 -0400, "mike" <me at no.where> wrote:

>If someone could tell me the proper
>API calls for  instantiating a new-style class, or point me to an example,
>I'd really appreciate it.

I'm relatively new at extending/embedding so I don't know if this has
changed, but doing this recently I simply noted that Python class
objects are callables and that calling them returns an instantiation.
I use Boost.Python, but I imagine you can simply use
PyObject_CallMethod with the class object.


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list