[Zope-Checkins] CVS: Zope/doc - README_ExtensionClassUsers.txt:1.1.2.1

Matthew T. Kromer matt@zope.com
Thu, 13 Dec 2001 12:26:52 -0500


Update of /cvs-repository/Zope/doc
In directory cvs.zope.org:/tmp/cvs-serv32399

Added Files:
      Tag: matt-stability-branch
	README_ExtensionClassUsers.txt 
Log Message:
Added a readme about extensionclass.h changes


=== Added File Zope/doc/README_ExtensionClassUsers.txt ===
EXTENSION CLASS CHANGE
December 13, 2001
Zope 2.5.0b3

Zope is a heavy user of classes called ExtensionClasses; these classes allow
python code to inherit methods from base C classes.  Part of this
functionality is provided by extending the base Python type object with a few
addtional fields.

Starting in Zope 2.4, Zope switched to using Python 2.1.

Python2.1 defines a longer type object; ExtensionClass is based on Python 1.5's
type object. This causes a potential conflict for code which is not aware of
the distinction between the two type objects to erroneously dereference data
based on the new fields in the 2.1 type definition.

In Zope 2.5.0 beta 3, to address mounting stability concerns about Zope, the
base ExtensionClass header was modified to include the newer Python 2.1 type
fields, thus moving down the ExtensionClass specific fields.

Most ExtensionClass based source does NOT need to be modified; ExtensionClass.h
provides a macro named METHOD_CHAIN(methods) to build a list of methods provided
by the object.  This macro used to expand as

	{ methods , NULL }

but now will expand as

	0, 0, 0, 0, { methods , NULL }

to add the additional fields to the type object initializer.

However, any ExtensionClass which defines type initializers without using the
METHOD_CHAIN macro may need to be modified to align with the new header file.

All ExtensionClasses MUST be recompiled when upgrading past Zope 2.5.0b3.  For
most users, this has no relevance, since they use Zope Corporation provided
ExtensionClasses exclusively.  However, anyone with addtional Zope procucts
based on ExtensionClass will need to recompile them.