Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
38d24fb2ae48
Commit
a02be42e
authored
Nov 05, 2019
by
Nicolas Chauvat
Browse files
[cubicweb/utils] add QueryCache.__contains__() to improve dict-like behavior. Closes #255426
parent
3cf37ec616ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb/utils.py
View file @
38d24fb2
...
...
@@ -616,6 +616,9 @@ class QueryCache(object):
self
.
_data
=
{}
self
.
_lock
=
Lock
()
def
__contains__
(
self
,
key
):
return
key
in
self
.
_data
def
__len__
(
self
):
with
self
.
_lock
:
return
len
(
self
.
_data
)
...
...
Write
Preview
Supports
Markdown
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