[Zope-ZEO] Need for PersistentList

Jim Fulton jim@digicool.com
Fri, 19 Jan 2001 14:29:21 -0500


Andrew Kuchling wrote:
> 
> On Thu, Jan 18, 2001 at 04:35:37PM -0600, John D. Heintz wrote:
> >Finally, we need for Persistent classes to be hashable.
> 
> Hmm... Does __hash__() not work on an ExtensionClass? 

It works fine for me. I just implemented a hash method on
a Persistent class and verified that it gets called.

I also verified that if I don't implement __hash__, I get an
error, which I submit is a bonus, since it would be really 
bad for persistent objects to get accidentilly stored in a 
persistent hash table using their address.  

I guess it would be desireable for the default hash for a 
persistent object to be based on it's persistent id, but that
would noty work for objects whos persistent id hasn't been set.
It also breaks an unwritten rule that object ids should not be
used at the application level.  Hm. 

Jim


--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.org