Now I\'m dumping into a YAML document. It\'s working as it should for the most part. When I try to dump a hexadecimal such as \"0x2A\" it converts to 42. Isn\'t there any wa
Representing all int in hex format, without a HexInt class, can be done using:
int
HexInt
def hexint_presenter(dumper, data): return dumper.represent_int(hex(data)) yaml.add_representer(int, hexint_presenter)
With reference to this answer.