[Python-Dev] reference counting in Py3K
Josiah Carlson
jcarlson at uci.edu
Wed Sep 7 19:16:17 CEST 2005
Christopher Armstrong <radeex at gmail.com> wrote:
> On 9/7/05, Josiah Carlson <jcarlson at uci.edu> wrote:
> > Guido van Rossum <guido at python.org> wrote:
> > > On 9/6/05, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> > > > A better plan would be to build something akin to
> > > > Pyrex into the scheme of things, so that all the
> > > > refcount/GC issues are taken care of automatically.
> > >
> > > That sounds exciting. I have to admit that despite hearing many
> > > enthusiastic reviews, I've never used it myself -- in fact I've
> > > written very little C code in the last few years, and zero new
> > > extension modules. (Lots of Java, but that's another story. :-)
> >
> > Here's a perspective "from the trenches" as it were.
> >
> > Encouraging its use for the writing of new extension modules: ick, -1.
> > Writing pretty yet high performing Pyrex is an art that I'm not sure
> > anyone can master.
>
> I'd just like to put in that it seems like the suggestions to use
> Pyrex were aimed at C-library wrapping extensions, not necessarily
> ones that were written in C for performance (I gather that there are
> very few of those, comparatively). So the encouragement to use Pyrex
> for new extension modules still seems perfect, to me; its use should
> definitely be encouraged when one needs to wrap some third-party
> library, and I'd bet that that's the common case.
To me, "new extension modules" != "wrapping C libraries for use with
Python standard library inclusion". The latter is perfectly fine, the
former may lead to fast but ugly Pyrex modules...
But what if you don't want speed from pure Pyrex modules? Then why
write them in Pyrex, why not stick with Python, or go to C for the speed,
and Pyrex for the wrapping?
- Josiah
More information about the Python-Dev
mailing list