Commit eff611f0 authored by Tim Peters's avatar Tim Peters

Merge revs 28249 and 28250 from trunk.

Document _p_invalidate().
parent 2f9dbfde
...@@ -149,7 +149,8 @@ class IPersistent(Interface): ...@@ -149,7 +149,8 @@ class IPersistent(Interface):
- call _p_deactivate() - call _p_deactivate()
- set _p_changed to None - set _p_changed to None
There is one way to invalidate an object: delete its _p_changed There are two ways to invalidate an object: call the
_p_invalidate() method (preferred) or delete its _p_changed
attribute. This cannot be ignored, and is used when semantics attribute. This cannot be ignored, and is used when semantics
require invalidation. Normally, an invalidated object transitions require invalidation. Normally, an invalidated object transitions
to the ghost state. However, some objects cannot be ghosts. When to the ghost state. However, some objects cannot be ghosts. When
...@@ -235,6 +236,15 @@ class IPersistent(Interface): ...@@ -235,6 +236,15 @@ class IPersistent(Interface):
may choose to keep an object in the saved state. may choose to keep an object in the saved state.
""" """
def _p_invalidate():
"""Invalidate the object.
Invalidate the object. This causes any data to be thrown
away, even if the object is in the changed state. The object
is moved to the ghost state; further accesses will cause
object data to be reloaded.
"""
class IPersistentNoReadConflicts(IPersistent): class IPersistentNoReadConflicts(IPersistent):
def _p_independent(): def _p_independent():
"""Hook for subclasses to prevent read conflict errors. """Hook for subclasses to prevent read conflict errors.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment