| 156 | |
| 157 | |
| 158 | class Token(metaclass=TokenMeta): |
| 159 | |
| 160 | MISSING = object() |
| 161 | |
| 162 | def __init__(self, context, var, old_value): |
| 163 | self._context = context |
| 164 | self._var = var |
| 165 | self._old_value = old_value |
| 166 | self._used = False |
| 167 | |
| 168 | @property |
| 169 | def var(self): |
| 170 | return self._var |
| 171 | |
| 172 | @property |
| 173 | def old_value(self): |
| 174 | return self._old_value |
| 175 | |
| 176 | def __repr__(self): |
| 177 | r = '<Token ' |
| 178 | if self._used: |
| 179 | r += ' used' |
| 180 | r += ' var={!r} at {:0x}>'.format(self._var, id(self)) |
| 181 | return r |
| 182 | |
| 183 | |
| 184 | def copy_context(): |
no outgoing calls
no test coverage detected
searching dependent graphs…