[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Include modsupport.h,2.35,2.36

Guido van Rossum guido@digicool.com
Thu, 25 Jan 2001 17:32:32 -0500


> > The addition of new parameters to functions in the Python/C API requires
> > that PYTHON_API_VERSION be incremented.
> 
> When we update the API version, isn't it time to clean up the TP_HASFEATURE
> stuff ? Since we updated the API, all the current slots should be there,
> right ?

No, we're issuing a warning about old API versions but still try to
work with them.  After all most extensions don't create frame or code
objects.

I added the flags for the tp_richcompare field when I tried 2.1a1 with
Zope's ExtensionClasses and Acquisition modules.  Turns out I cot a
core dump, while 2.1 ran flawlessly.  The reason: they have their own
type struct which has the same lay-out as the Python 1.5.2 (or even
older) type struct, followed by fields of their own.  They have the
tp_flags field set to 0, so up to 2.0, it was compatible.  I expect
that 2.1a2 will work with the unchanged Zope code because of the flag
I added.

--Guido van Rossum (home page: http://www.python.org/~guido/)