Set the current value and return what is now the old value This is nice to use in ``lambda`` functions.
(self, new: _RefValue)
| 35 | """The present value""" |
| 36 | |
| 37 | def set_current(self, new: _RefValue) -> _RefValue: |
| 38 | """Set the current value and return what is now the old value |
| 39 | |
| 40 | This is nice to use in ``lambda`` functions. |
| 41 | """ |
| 42 | old = self.current |
| 43 | self.current = new |
| 44 | return old |
| 45 | |
| 46 | def __eq__(self, other: object) -> bool: |
| 47 | try: |
no outgoing calls