The pickle library we're using (gopickle) uses a types.GenericClass and types.GenericObject to represent custom classes and objects found in a pickle stream. For the common case where the class is a @dataclass, these types aren't sufficient; an error occurs when the pickle library tries to set __dict__ properties, since *types.GenericObject doesn't implement types.PyDictSettable. This PR updates the formatter to instead use a custom generic object type which implements PyDictSettable. The result is that we can properly format data classes.
I've also updated the formatting layer to log more information when it encounters a Python value it can't parse.
The pickle library we're using (gopickle) uses a
types.GenericClass
andtypes.GenericObject
to represent custom classes and objects found in a pickle stream. For the common case where the class is a@dataclass
, these types aren't sufficient; an error occurs when the pickle library tries to set__dict__
properties, since*types.GenericObject
doesn't implementtypes.PyDictSettable
. This PR updates the formatter to instead use a custom generic object type which implementsPyDictSettable
. The result is that we can properly format data classes.I've also updated the formatting layer to log more information when it encounters a Python value it can't parse.