logo       

Re: How do I subtype python internal type that is not part of a module?: msg#00038

python.pyrex

Subject: Re: How do I subtype python internal type that is not part of a module?

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

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg@xxxxxxxxxxxxxxxxxxxxx +--------------------------------------+


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

News | FAQ | advertise