[Zope-dev] To the brave folks trying Zope HEAD...

Jeremy Hylton jeremy at zope.com
Wed Dec 10 15:26:03 EST 2003


Actually, there are two equally valuable clues from the debugger
session:

object  : <class 'Products.Formulator.StandardFields.LabelField'>
type    : ExtensionClass.ExtensionClass
refcount: 7
address : 0x8503bec

If I understand correctly: LabelField is a class that inherits from
Persistence and some other object has a reference to it that isn't via
__class__.  

>>> persistent.Persistent._p_jar
<attribute '_p_jar' of 'persistent.Persistent' objects>

If you ask a class for an attribute, it seems you can get a descriptor
back.  I vaguely recall Guido saying that this was the intended behavior
last time I asked about it.

'jar' gives:
object  : <attribute '_p_jar' of 'persistent.Persistent' objects>
type    : getset_descriptor
refcount: 2
address : 0x40621e6c

Thus, asking for the class's _p_jar gives the descriptor back.  In ZODB4
I hacked around this by requiring that the value of _p_jar be None or a
string.  Would there be any objection to having the same requirement in
ZODB3?

Jeremy





More information about the Zope-Dev mailing list