Skip to content

Commit

Permalink
document load_current, including its somewhat tenuous nature.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Jun 17, 2016
1 parent 347b9f5 commit e8a853a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ZODB/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,18 @@ def notify_all(self):
import ZODB.POSException

def load_current(storage, oid, version=''):
"""Load the most recent revision of an object by calling loadBefore
Starting in ZODB 5, it's no longer necessary for storages to
provide a load method.
This function is mainly intended to facilitate transitioning from
load to loadBefore. It's mainly useful for tests that are meant
to test storages, but do so by calling load on the storages.
This function will likely become unnecessary and be deprecated
some time in the future.
"""
assert not version
r = storage.loadBefore(oid, maxtid)
if r is None:
Expand Down

0 comments on commit e8a853a

Please sign in to comment.