Re: class attributes and inner classes in C extensions

2005-04-01 Thread harold fellermann
I think you could as well, after PyType_Ready() is called, set it yourself with PyObject_SetAttrString(FooType, "Bar", FooBarType); You *may* have to cast the FooType and FooBarType to (PyObject *), to avoid compiler warnings. I tried this. Its shorter and and works fine, too. thanks for the pro

Re: class attributes and inner classes in C extensions

2005-04-01 Thread Thomas Heller
harold fellermann <[EMAIL PROTECTED]> writes: >> I am working on a C extension module that implements a bunch of >> classes. Everything >> works fine so far, but I cannot find any way to implement class >> attributes or inner >> classes. Consider you have the following lines of Python : >> >> clas

Re: class attributes and inner classes in C extensions

2005-04-01 Thread harold fellermann
I am working on a C extension module that implements a bunch of classes. Everything works fine so far, but I cannot find any way to implement class attributes or inner classes. Consider you have the following lines of Python : class Foo : class Bar : pass spam = "foo