Open pwwang opened 1 year ago
Makes sense we need to try the next tp_base
like here.
Shouldn't be too hard to fix, would you like to have a try.
This still prevents me from upgrading rtoml to 0.11 for some of my projects.
Originally comments with the PR:
Can we add something to make it work at the python end?
For example, at dump(obj, ...)
or dumps(obj, ...)
, can we do:
def dump(obj, ...):
if issubclass(type(obj), dict):
obj = dict(obj)
# continue logic
well the problem is it needs to be recursive.
You could add your own method to do this. By the way, it's better to use use type(x)
in a lookup, then work through the __mro__
, like we did in pydantic v1.
well the problem is it needs to be recursive.
That's a good point. Maybe I'll just wrap it myself.
Feel free to close.
Ultimate solution is https://github.com/pydantic/pydantic-core/issues/1339, I'll leave this open for that.