[C++-sig] def_init required

David Abrahams david.abrahams at rcn.com
Wed May 22 23:25:09 CEST 2002


----- Original Message -----
From: "Achim Domma" <achim.domma at syynx.de>
To: "C++-Sig at Python. Org" <c++-sig at python.org>
Sent: Wednesday, May 22, 2002 4:23 PM
Subject: [C++-sig] def_init required


> Hi,
>
> see below a small test extension. If I don't call def_init on
> class_<HelloWorld> I can load the extension and create an object, but if
I
> call 'showIt', I get the following error:
>
> TypeError: bad argument type for built-in operation
>
> Is def_init required for each class?

If the instance is going to be created by calling the class, then yes.
That's what creates the C++ instance. I plan to try to do something which
will create a default def_init() if you don't declare one, but I'm not sure
whether it's possible.

-Dave







More information about the Cplusplus-sig mailing list