It would be nice if the struct classes could be conveniently serialized to dictionaries, e.g. to transmit the events via json.
My suggestion would be a method as_dict() in every struct class, which simply stores its fields as dictionary where references to other classes are serialized to dicts as well.
This is part of an improvement I've had in mind where the structs are defined via a declarative language instead of being straight up classes, and this would be one of the primary features.
It would be nice if the struct classes could be conveniently serialized to dictionaries, e.g. to transmit the events via json. My suggestion would be a method
as_dict()
in every struct class, which simply stores its fields as dictionary where references to other classes are serialized to dicts as well.I could do this in a PR if you like the idea.