MCPcopy Create free account
hub / github.com/celery/celery / pop

Method pop

celery/utils/threads.py:269–282  ·  view source on GitHub ↗

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

267 return rv
268
269 def pop(self):
270 """Remove the topmost item from the stack.
271
272 Note:
273 Will return the old value or `None` if the stack was already empty.
274 """
275 stack = getattr(self._local, 'stack', None)
276 if stack is None:
277 return None
278 elif len(stack) == 1:
279 release_local(self._local)
280 return stack[-1]
281 else:
282 return stack.pop()
283
284 __class_getitem__ = classmethod(types.GenericAlias)
285

Callers 15

wrapperFunction · 0.45
restore_execv_stateFunction · 0.45
environFunction · 0.45
reset_modulesFunction · 0.45
module_existsFunction · 0.45
test_stackMethod · 0.45
test_stackMethod · 0.45
test_no_cpickleMethod · 0.45

Calls 1

release_localFunction · 0.85

Tested by 15

wrapperFunction · 0.36
restore_execv_stateFunction · 0.36
environFunction · 0.36
reset_modulesFunction · 0.36
module_existsFunction · 0.36
test_stackMethod · 0.36
test_stackMethod · 0.36
test_no_cpickleMethod · 0.36