[Zope-dev] Creating ExtensionClass instances in C

James Henstridge james@daa.com.au
Fri, 14 Apr 2000 08:13:32 +0800 (WST)


Have you tried calling it?  That seems to be what python does in order to
create instances.  Something like:
  instance = PyObject_CallFunction((PyObject *)extension_class,
                                   "formatstring", constructor_args);

I think that should also work on normal python classes.

BTW, I have my extensionclass C subclassing patch in the collector at:
  http://classic.zope.org:8080/Collector/1179/view

if anyone wants it.  I also have an example of its use in the test release
of my python bindings for gtk at:
  ftp://ftp.daa.com.au/pub/james/python/pygtk-0.7.0-unstable-dont-use.tar.gz

(I should probably put up a newer snapshot at some point).

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Thu, 13 Apr 2000, Andrew M. Kuchling wrote:

> Here's a simple question about the ExtensionClass API: if I write an
> ExtensionClass, how do I create an instance of it from C code?  
> There's no obvious API function that does this...
> 
> --amk
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>