MCPcopy
hub / github.com/pallets/werkzeug / pop

Method pop

src/werkzeug/local.py:147–158  ·  view source on GitHub ↗

Remove the top item from the stack and return it. If the stack is empty, return ``None``.

(self)

Source from the content-addressed store, hash-verified

145 return stack
146
147 def pop(self) -> T | None:
148 """Remove the top item from the stack and return it. If the
149 stack is empty, return ``None``.
150 """
151 stack = self._storage.get([])
152
153 if len(stack) == 0:
154 return None
155
156 rv = stack[-1]
157 self._storage.set(stack[:-1])
158 return rv
159
160 @property
161 def top(self) -> T | None:

Callers 15

test_local_stackFunction · 0.95
content_typeMethod · 0.45
content_lengthMethod · 0.45
set_cookieMethod · 0.45
delete_cookieMethod · 0.45
_add_cookies_to_wsgiMethod · 0.45
resolve_redirectMethod · 0.45
send_fileFunction · 0.45
parse_accept_headerFunction · 0.45
__delete__Method · 0.45
_get_args_for_reloadingFunction · 0.45

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by 15

test_local_stackFunction · 0.76
content_typeMethod · 0.36
content_lengthMethod · 0.36
set_cookieMethod · 0.36
delete_cookieMethod · 0.36
_add_cookies_to_wsgiMethod · 0.36
resolve_redirectMethod · 0.36
closeMethod · 0.36
test_basic_interfaceMethod · 0.36
test_multidict_popMethod · 0.36