|
Re[2]: How do I subtype python internal type that is not part of a module?: msg#00044python.pyrex
On Mon, 19 Apr 2004 19:52:06 +1200 Greg Ewing <greg@xxxxxxxxxxxxxxxxxxxxx> wrote: > Lenard Lindstrom <len-l@xxxxxxxxx>: > > > I have enhanced my python interpeter to allow subtyping of python > > functions and wish to create some extension types directly from > > PyFunction_Type. Unfortunately the type is not part of any module. I > > have tried the following pyrex code: > > It's available in the "types" module, so you should be > able to say > > cdef extern from "python.h": > ctypedef class types.FunctionType [object PyFunctionObject]: > pass Thank you. It worked. Just one thought though. Would it be useful if Pyrex provided some way to directly declare an extension subtype from a PyType_Type instance declared in another C file? If one needs full control of memory management for example, one would write a base type in C, then use Pyrex to create the extension module boiler plate and any subtypes. The Pyrex output file would be linked with the C base type file to make the final extension module. Lenard Lindstrom <len-l@xxxxxxxxx> |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Pyrex IDE: 00044, Voidspace |
|---|---|
| Next by Date: | Re: Bug? SystemError: error return without exception set: 00044, Atsuo Ishimoto |
| Previous by Thread: | Re: How do I subtype python internal type that is not part of a module?i: 00044, Greg Ewing |
| Next by Thread: | How to efficiently construct an extension instance from Pyrex?: 00044, Gary Bishop |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |