Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
788362ed
Commit
788362ed
authored
Oct 13, 2008
by
Christophe Combelles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted the indentation and kept the docformat (merge from the 3.8 branch)
parent
69c64d9f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
103 deletions
+103
-103
src/persistent/wref.py
src/persistent/wref.py
+103
-103
No files found.
src/persistent/wref.py
View file @
788362ed
...
...
@@ -95,7 +95,7 @@ class WeakRef(object):
...
TypeError: Weakly-referenced object has gone away
Always explicitly close databases
:) :
Always explicitly close databases
: :)
>>> db.close()
...
...
@@ -144,7 +144,7 @@ class PersistentWeakKeyDictionary(Persistent):
of items is extremely lazy. See below.
We'll start by creating a PersistentWeakKeyDictionary and adding
some persistent objects to it
:
some persistent objects to it
.
>>> d = PersistentWeakKeyDictionary()
>>> import ZODB.tests.util
...
...
@@ -192,7 +192,7 @@ class PersistentWeakKeyDictionary(Persistent):
[True, True, True, False]
Likewise, we can read the objects from another connection and
things still work
:
things still work
.
>>> conn2 = db.open()
>>> d = conn2.root()['d']
...
...
@@ -213,7 +213,7 @@ class PersistentWeakKeyDictionary(Persistent):
>>> ZODB.tests.util.commit()
And pack the database, so that the no-longer referenced p2 is
actually removed from the database
:
actually removed from the database
.
>>> ZODB.tests.util.pack(db)
...
...
@@ -231,7 +231,7 @@ class PersistentWeakKeyDictionary(Persistent):
conn1 and conn2 still have p2, because p2 is still in the caches
for those connections.
Always explicitly close databases
:) :
Always explicitly close databases
: :)
>>> db.close()
...
...
@@ -271,7 +271,7 @@ class PersistentWeakKeyDictionary(Persistent):
del
self
.
data
[
WeakRef
(
key
)]
def
get
(
self
,
key
,
default
=
None
):
"""D.get(k[, d]) -> D[k] if k in D, else d.
:
"""D.get(k[, d]) -> D[k] if k in D, else d.
>>> import ZODB.tests.util
>>> key = ZODB.tests.util.P("key")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment