On Wed, Dec 10, 2003 at 03:26:03PM -0500, Jeremy Hylton wrote:
| 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__.  

Makes sense to me. How can I find the referencing object?

| >>> 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.

Yes, I've learnt this the hard way, when Jim tried to explain me and I
kept banging my head against the wall :)

| '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?

I have no clue about the implications of this, but it seems like a
reasonable constraint to me.

Sidnei da Silva <[EMAIL PROTECTED]>
http://awkly.org - dreamcatching :: making your dreams come true

MS-DOS, you can't live with it, you can live without it.
        -- from Lars Wirzenius' .sig

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to