# HG changeset patch # User Nicolas Chauvat # Date 1572992355 -3600 # Node ID 38d24fb2ae4882603a13355b95ca203cb6b4e9d1 # Parent 3cf37ec616ad341b1bdf5b84cdafdb3a6608def5 [cubicweb/utils] add QueryCache.__contains__() to improve dict-like behavior. Closes #255426 diff -r 3cf37ec616ad -r 38d24fb2ae48 cubicweb/utils.py --- a/cubicweb/utils.py Thu May 23 00:33:31 2019 +0200 +++ b/cubicweb/utils.py Tue Nov 05 23:19:15 2019 +0100 @@ -616,6 +616,9 @@ self._data = {} self._lock = Lock() + def __contains__(self, key): + return key in self._data + def __len__(self): with self._lock: return len(self._data)