logo       

How to efficiently construct an extension instance from Pyrex?: msg#00035

python.pyrex

Subject: How to efficiently construct an extension instance from Pyrex?

I'm making an extension type with Pyrex and having a good time! My __init__ method offers a lot of flexibility with several argument variations for the Python user.

My problem is that I also need to construct objects from within my Pyrex methods. I'd like these constructions with VERY simple arguments to be efficient.

Can I have a constructor that I use from Pyrex and a different one I use from Python? I've experimented a bit with PyInstance_NewRaw but with no success. It seems to me that calling PyInstance_NewRaw(self.__class__,0) ought to create a new instance of the same class as the current object but it fails with "bad argument to internal function call".

Other suggestions for efficiently creating extension objects from within Pyrex?

Thanks
gb


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise