Serialize this options object to binary data.
(self)
| 453 | return d |
| 454 | |
| 455 | def to_bytes(self) -> bytes: |
| 456 | """Serialize this options object to binary data.""" |
| 457 | assert self.transform_source is None, "Source transform cannot be serialized" |
| 458 | snapshot = self.snapshot() |
| 459 | # Caller will need to use process_error_codes() to re-compute these. |
| 460 | del snapshot["disabled_error_codes"] |
| 461 | del snapshot["enabled_error_codes"] |
| 462 | buf = WriteBuffer() |
| 463 | write_json(buf, snapshot) |
| 464 | return buf.getvalue() |
| 465 | |
| 466 | def __repr__(self) -> str: |
| 467 | return f"Options({pprint.pformat(self.snapshot())})" |
no test coverage detected