MCPcopy
hub / github.com/celery/celery / pop

Method pop

celery/utils/threads.py:214–227  ·  celery/utils/threads.py::_LocalStack.pop

Remove the topmost item from the stack. Note: Will return the old value or `None` if the stack was already empty.

(self)

Source from the content-addressed store, hash-verified

212 return rv
213
214 def pop(self):
215 class="st">"""Remove the topmost item from the stack.
216
217 Note:
218 Will return the old value or `None` if the stack was already empty.
219 class="st">"""
220 stack = getattr(self._local, &class="cm">#x27;stack', None)
221 if stack is None:
222 return None
223 elif len(stack) == 1:
224 release_local(self._local)
225 return stack[-1]
226 else:
227 return stack.pop()
228
229 def __len__(self):
230 stack = getattr(self._local, &class="cm">#x27;stack', None)

Callers 15

environFunction · 0.45
reset_modulesFunction · 0.45
module_existsFunction · 0.45
test_stackMethod · 0.45
test_stackMethod · 0.45
test_no_cpickleMethod · 0.45
test_on_electMethod · 0.45

Calls 1

release_localFunction · 0.85

Tested by 15

environFunction · 0.36
reset_modulesFunction · 0.36
module_existsFunction · 0.36
test_stackMethod · 0.36
test_stackMethod · 0.36
test_no_cpickleMethod · 0.36
test_on_electMethod · 0.36