A small serializable object to wrap literal values without copying
| 502 | |
| 503 | |
| 504 | class literal: |
| 505 | """A small serializable object to wrap literal values without copying""" |
| 506 | |
| 507 | __slots__ = ("data",) |
| 508 | |
| 509 | def __init__(self, data): |
| 510 | self.data = data |
| 511 | |
| 512 | def __repr__(self): |
| 513 | return f"literal<type={type(self.data).__name__}>" |
| 514 | |
| 515 | def __reduce__(self): |
| 516 | return (literal, (self.data,)) |
| 517 | |
| 518 | def __call__(self): |
| 519 | return self.data |
| 520 | |
| 521 | |
| 522 | def quote(x): |
no outgoing calls
searching dependent graphs…