[ZODB-Dev] ZODB3.3.0b1 and ExtensionClass?

Tim Peters tim at zope.com
Fri Jun 25 12:23:46 EDT 2004


[Christian Robottom Reis]
> I've started to get IndexedCatalog working with ZODB3.3. So far, it's
> been quite miserable, however. The reason is that IndexedCatalog's base
> class uses ExtensionClasses, and I've been unable to get ExtensionClass
> set up at all with 3.3.

The NEWS file for ZODB 3.3a2 (from January) reads (in part):

    This release contains a major overhaul of the persistence machinery,
    including some user-visible changes.  The Persistent base class is
    now a new-style class instead of an ExtensionClass.  The change
    enables the use of features like properties with persistent object
    classes.  The Persistent base class is now contained in the persistent
    package.

    The Persistence package is included for backwards compatibility.  The
    Persistence package is used by Zope to provide special ExtensionClass-
    compatibility features like a non-C3 MRO and an __of__ method.
    ExtensionClass is not included with this release of ZODB3.  If you use
    the Persistence package, it will print a warning and import Persistent
    from persistent.

    In short, the new persistent package is recommended for non-Zope
    applications. The following dotted class names are now preferred over
    earlier names:

        persistent.Persistent 
        persistent.list.PersistentList 
        persistent.mapping.PersistentMapping 
        persistent.TimeStamp

> Being unable to find an ExtensionClass package, I pulled the code from
> svn head, compiled and installed it.

Which SVN trunk?  ZODB's?  Then that won't work.  The Zope trunk still
includes and compiles ExtensionClass code, but that's no longer part of
ZODB.

...

> So I'm at a point where I want to understand my alternatives.
>
>     a) Is ZODB-3.3 + ExtensionClass broken right now, or do I need to
>        learn the magical incantations that will make it fly?

ZODB on its own doesn't intend to support ExtensionClass anymore.  If you
*need* to get 3.3 working with ExtensionClass, I personally don't know
details about how, but what's needed should be available from Zope's SVN
trunk.

>        Is there an ExtensionClass tarball I should be using?

Sorry, don't know.

>        I assume that some Zope packages use EC and because of that there
>        is some way it should work, but I can't see how.

Yes, it should work "out of the box" in the context of a Zope 2.8 checkout.

>     b) Is this at all useful for me, however? Is ExtensionClass still
>        code-compatible (at the C level) to my extension, or am I better
>        off rewriting the bits that depend on EC to stop doing so?

EC existed in the first place mostly because it wasn't possible to define
Python classes in C code at the time.  Python changed since then ("new-style
class"), and so the primary reason for EC's existence has gone away.  For
example, Zope 3 doesn't use EC at all.

> I'm leaning towards b) after spending a morning chasing compile and
> import errors all over the place. Anybody had similar problems moving on
> to 3.3?

Not me <wink>.  Seriously, if you can wean yourself from EC, that would be a
Good Thing.  EC doesn't play well (or at all) with newer Python features,
and is being phased out.



More information about the ZODB-Dev mailing list