Extension programming question (2.2)
Michael Hudson
mwh at python.net
Mon Feb 3 07:19:06 EST 2003
Ken Seehof <kseehof at neuralintegrator.com> writes:
> Well that's what it was doing yesterday, I swear it! :-) Today, type is
> ni_object. Hmm, must have something to do with the day of the week.
Probably.
>> I think you need to set tp_alloc to PyType_GenericAlloc
>>and call that instead:
>>
>> c_ni_object__object *self =
>> (c_ni_object__object*)type->tp_alloc(type, 0);
>
> Well, that explains it. Silly mistake. BTW, I implemented tp_new instead
> of using PyType_GenericAlloc because I wanted some initialization (deleted
> in my sample code for simplicity). Actually as it turns out I can work with
> tp_init instead.
Don't sweat it, there's a lot of new stuff to learn in this area. I
went poking around the source to be able to answer your question...
Cheers,
M.
--
... Windows proponents tell you that it will solve things that
your Unix system people keep telling you are hard. The Unix
people are right: they are hard, and Windows does not solve
them, ... -- Tim Bradshaw, comp.lang.lisp
More information about the Python-list
mailing list