Remove the topmost item from the stack. Note: Will return the old value or `None` if the stack was already empty.
(self)
| 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) |