Comment 0 for bug 143657

Revision history for this message
Dieter Maurer (d.maurer) wrote :

Uploaded: ec_getnewargs.pat

The ZODB implements an important optimization for persistent references:
it can include a class reference in a persistent reference
such that a ghost can be instanciated without loading the object.

In order for this optimization to be possible, the class must
not define "__getnewargs__". Unfortunately, "ExtensionClass.Base"
defines it and therefore prevents this optimization for
ExtensionClass instances (i.e. for all Zope2 objects).

The attached patch removes the "__getnewargs__" definition
from "ExtensionClass.Base", changes the "_reduce" definition
accordingly and updates the tests.