python json字符串中有int类型数字(不带引号)

def jsonfy(s:str)->object:
    obj = eval(s, type('js', (dict,), dict(__getitem__=lambda s, n: n))())
    return obj

  

posted on 2019-08-02 09:50  hailuo  阅读(1968)  评论(0编辑  收藏  举报