Lines Matching refs:key
110 element. This is important because the cacheresult() will hash the key
130 Make a cache key from optionally typed positional and keyword arguments.
131 The key is constructed in a way that is flat as possible rather than as
139 key = args
141 key += kwd_mark
143 key += item
145 key += tuple(type(v) for v in args)
147 key += tuple(type(v) for v in kwds.values())
148 elif len(key) == 1 and type(key[0]) in fasttypes:
149 return key[0]
150 return _HashedSeq(key)
162 make_key = _make_key # build a key from the function arguments
166 key = _make_key(args, kwds, typed)
167 result = cache.get(key, sentinel)
171 cache[key] = result
185 self.map = {} # key --> [key, prev, next]
192 def __contains__(self, key):
193 return key in self.map
195 def add(self, key):
196 if key not in self.map:
199 curr[2] = end[1] = self.map[key] = [key, curr, end]
202 for key in keys:
203 self.add(key)
205 def discard(self, key):
206 if key in self.map:
207 key, prev, next = self.map.pop(key)
228 key = self.end[1][0] if last else self.end[2][0]
229 self.discard(key)
230 return key
342 def append_dictlist(dict_, key, value):
344 Append the `value` to a list associated with `key` in `dict_`.
345 If `key` doesn't exist, create a new list in the `dict_` with value in it.
347 list_ = dict_.get(key, [])
349 dict_[key] = list_