Push a new item to the stack.
(self, obj)
| 257 | return Proxy(_lookup) |
| 258 | |
| 259 | def push(self, obj): |
| 260 | """Push a new item to the stack.""" |
| 261 | rv = getattr(self._local, 'stack', None) |
| 262 | if rv is None: |
| 263 | # pylint: disable=assigning-non-slot |
| 264 | # This attribute is defined now. |
| 265 | self._local.stack = rv = [] |
| 266 | rv.append(obj) |
| 267 | return rv |
| 268 | |
| 269 | def pop(self): |
| 270 | """Remove the topmost item from the stack. |
no outgoing calls