[Pyrex] Re: return "cdef class"

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Apr 29 02:33:30 CEST 2003


Haris Bogdanovic <haris.bogdanovic at zg.hinet.hr> wrote:

> Can a python function return object which is defined in the same .pyx =
> file as "cdef class" ?

Sure, just instantiate it the way you normally do in
Python, e.g.

  cdef class Spam:
    ...

  def make_spam:
    return Spam()

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list