[Pyrex] A couple of questions about pyrex

Yingjie Lan lanyjie at yahoo.com
Thu May 14 00:53:43 CEST 2009


> From: Robert Bradshaw <robertwb at math.washington.edu>
> Subject: Re: [Pyrex] A couple of questions about pyrex
> To: lanyjie at yahoo.com, "Pyrex List" <pyrex at lists.copyleft.no>
> Date: Wednesday, May 13, 2009, 6:09 AM
> I meant to send this to the list...
> 
> On May 12, 2009, at 4:12 PM, Yingjie Lan wrote:
> 
> > 
> > --- On Wed, 5/13/09, Robert Bradshaw <robertwb at math.washington.edu>
> wrote:
> > 
> >> cdef class A:
> >>    pass
> >> 
> >> and
> >> 
> >> class A:
> >>     pass
> >> 
> >> create very different objects. Implicitly creating
> one or
> >> the other depending on the contents of the body
> seems like a
> >> bad idea. Maybe if/once we have extension classes
> that
> >> behave semantically exactly like Python classes we
> could do
> >> this, but the "cdef class" wouldn't go away
> >> (in Cython at least) because one often wants the
> extension
> >> type behavior.
> >> 
> > 
> > Thanks for the explanation. Could you please also
> elaborate on the difference between the created objects and
> why people would want to have the difference?
> 
> As well as what Greg Ewing stated, normal Python classes
> support multiple inheritance and come with default support
> for pickling/copy.
> 

I see. Thanks for the explanation. 

So, let me back off ... it seems hard to please everybody.

I read pretty much all the beginner's documentation but
did not find anything on writing a pure python class
in your .pyx file. It is a little weird to have an
extension language that also support pure python class.
Why not just write that into a pure python module?


yingjie



      



More information about the Pyrex mailing list