MCPcopy
hub / github.com/cherrypy/cherrypy / pop

Method pop

cherrypy/lib/sessions.py:338–349  ·  view source on GitHub ↗

Remove the specified key and return the corresponding value. If key is not found, default is returned if given, otherwise KeyError is raised.

(self, key, default=missing)

Source from the content-addressed store, hash-verified

336 del self._data[key]
337
338 def pop(self, key, default=missing):
339 """Remove the specified key and return the corresponding value.
340
341 If key is not found, default is returned if given, otherwise
342 KeyError is raised.
343 """
344 if not self.loaded:
345 self.load()
346 if default is missing:
347 return self._data.pop(key)
348 else:
349 return self._data.pop(key, default)
350
351 def __contains__(self, key):
352 if not self.loaded:

Callers 15

find_handlerMethod · 0.80
find_handlerMethod · 0.80
decoratedFunction · 0.80
urlFunction · 0.80
normalize_pathFunction · 0.80
_setupMethod · 0.80
_setupMethod · 0.80
_setupMethod · 0.80
_setupMethod · 0.80
set_responseMethod · 0.80
set_responseMethod · 0.80
finalizeMethod · 0.80

Calls 1

loadMethod · 0.95

Tested by 2

testErrorHandlingMethod · 0.64
_cp_dispatchMethod · 0.64