Can someone please explain the best way for me to map from one instance
to another?

In the following code either:
(1) I am using dictionaries wrong, or
(2) I'm missing something with ExtensionClass in general.  

I have tried searching Zope and Python mailing lists and resources for
an answer to this question but have become confused by different
conflicting messages.  On the one hand I have heard that dictionary keys
are supposed to be immutable.  On the other, I've heard that
dictionaries are used to simulate (key is object, value is ignored) some
aspects of sets.  Which is correct?  

What I really want is to be able to map a Persistent object to a string
with fast lookup.

Thanks for any help.
John Heintz

import ZODB
from Persistence import Persistent

class Test1:

class Test2(Persistent):

dict = {}
t1 = Test1()
t2 = Test2()

    dict[t1] = 1
    print "Using instance of Test1 as key failed!"

    dict[t2] = 2
    print "Using instance of Test2(Persistent) as key failed!"

John D. Heintz
DataChannel, Inc.
Senior Engineer

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to