Commit f95d75ac authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

ENH: Cache.__contains__ method

parent 8ae241f0
......@@ -143,6 +143,13 @@ class Cache(object):
return self.put(key, value)
def __contains__(self, key):
"""Check whether an item is in the cache. Note that the item may
be in the cache, but it may be expired.
return key in self.__cache
def __parseDefault(self, *args, **kwargs):
"""Used by the :meth:`get` method. Parses the ``default`` argument,
which may be specified as either a positional or keyword argumnet.
Supports Markdown
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