ANN.: Beta 1.0 of Weak Reference Extension Module is now available

Johann Hibschman johann at physics.berkeley.edu
Thu Nov 16 14:07:15 CET 2000


Courageous  writes:

>>> Looks neat!  But maybe you could answer me a quick question, since I
>>> really don't understand weak references.

> Suppose you are designing a cache.

It's still not obvious to me.  Say I had a database that I was
caching.  Then

  x = database.get('RECORD_ID')

would only get the file from disk once, etc.  But the cache itself is
invisible; it's entirely under the hood.  Once you have the data
object, you have it.

Are you saying that once you have the object, something weird might
happen elsewhere that means you no longer have it?  That seems like a
sign that you don't really have the object at all, or that you don't
have synchronization working quite right.

-- 
Johann Hibschman                           johann at physics.berkeley.edu



More information about the Python-list mailing list