[Zodb-checkins] CVS: Zope3/src/persistence - cache.py:1.4

Tim Peters tim@zope.com
Tue, 11 Mar 2003 17:32:01 -0500


[Jeremy Hylton]
> No it wasn't in the right order.  Added a comment explaining the order
> it should be in.  How is it that almost every time I call sort() I also
> have to call reverse()?

Just because you didn't implement list_sort -- because I did, it fears me
enough to sort the way I intended the first time <wink>.

In this case, I'd probably do instead

    delta = ob._p_atime - now
    if delta > 0:
        delta -= 86400

and use that ("seconds from now") as the primary sort key.  I expect this is
just the negation of what you're using now.