msgpack/msgpack-python

How can I unpack a map with a key of custom type from another language?

sjwsl opened this issue · 0 comments

sjwsl commented

I have something like

struct T {
    int a;
    int b;
};

map<T, int> data;

in another language and serialize it with msgpack. When I tried to unpack it with msgpack-python, I got TypeError: unhashable type: 'dict'. I think that's because Python doesn't allow dict as a key of another dict. Is there any workaround for it? Thanks.