Re: A couple of questions about pyrex
Yingjie Lan <[email protected]> Wed, 13 May 2009 15:53:43 -0700 (PDT)
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
> From: Robert Bradshaw <[email protected]> > Subject: Re: [Pyrex] A couple of questions about pyrex > To: [email protected], "Pyrex List" <[email protected]> > 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 <[email protected]> > 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