how to make JSONEncoder work with typing.NamedTuple

后端 未结 0 758
忘掉有多难
忘掉有多难 2020-11-27 04:09
class MyEncoder(JSONEncoder):
    # this is the only worked approach
    def iterencode(self, obj, *args, **kwargs):
        if isinstance(obj, tuple) and hasattr(ob         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题