Extension objects in Python 1.5 and 2.2

Martin Sjögren martin at strakt.com
Thu Jun 13 11:40:26 CEST 2002


On Thu, Jun 13, 2002 at 09:20:53AM +0000, Michael Hudson wrote:
> Martin Sjögren <martin at strakt.com> writes:
> 
> > On Thu, Jun 13, 2002 at 02:31:49AM -0500, Skip Montanaro wrote:
> > > 
> > >     Martin> How do I write extension objects so that they work in both
> > >     Martin> Python 1.5 and the 2.x series? 
> > > 
> > > Michael Hudson has been working on a new include file named pymemcompat.h.
> > > Since it's only used for backward compatibility it's in the Misc directory.
> > > You can grab it from CVS:
> > > 
> > >     http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Misc/pymemcompat.h
> > > 
> > > The idea is that you should be able to include it and program to the 2.3
> > > memory api in code that runs under 1.5.2 or newer versions of the
> > > interpreter.
> > 
> > Cool. Thanks a lot!
> 
> Pleasure!  Be sure to complain if it doesn't work, won't you?

So far it's looking good. I still had to ifdef on the Python version since
I'd used PyModule_AddObject, but that was easily fixed.

Regards,
Martin

-- 
Martin Sjögren
  martin at strakt.com              ICQ : 41245059
  Phone: +46 (0)31 7710870       Cell: +46 (0)739 169191
  GPG key: http://www.strakt.com/~martin/gpg.html





More information about the Python-list mailing list