(self, value)
| 106 | raise LookupError |
| 107 | |
| 108 | def set(self, value): |
| 109 | ctx = _get_context() |
| 110 | data = ctx._data |
| 111 | try: |
| 112 | old_value = data[self] |
| 113 | except KeyError: |
| 114 | old_value = Token.MISSING |
| 115 | |
| 116 | updated_data = data.set(self, value) |
| 117 | ctx._data = updated_data |
| 118 | return Token(ctx, self, old_value) |
| 119 | |
| 120 | def reset(self, token): |
| 121 | if token._used: |