MCPcopy Index your code
hub / github.com/python/mypy / to_bytes

Method to_bytes

mypy/options.py:455–464  ·  view source on GitHub ↗

Serialize this options object to binary data.

(self)

Source from the content-addressed store, hash-verified

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())})"

Callers 1

buildFunction · 0.45

Calls 2

snapshotMethod · 0.95
write_jsonFunction · 0.90

Tested by

no test coverage detected