Push a new item to the stack.
(self, obj)
| 202 | return Proxy(_lookup) |
| 203 | |
| 204 | def push(self, obj): |
| 205 | """Push a new item to the stack.""" |
| 206 | rv = getattr(self._local, 'stack', None) |
| 207 | if rv is None: |
| 208 | # pylint: disable=assigning-non-slot |
| 209 | # This attribute is defined now. |
| 210 | self._local.stack = rv = [] |
| 211 | rv.append(obj) |
| 212 | return rv |
| 213 | |
| 214 | def pop(self): |
| 215 | """Remove the topmost item from the stack. |
no outgoing calls