Fix error in json deserialize demo
should return obj after setting all attrbutes.
This commit is contained in:
@@ -209,7 +209,7 @@ JSON编码的格式对于Python语法而已几乎是完全一样的,除了一
|
|||||||
obj = cls.__new__(cls) # Make instance without calling __init__
|
obj = cls.__new__(cls) # Make instance without calling __init__
|
||||||
for key, value in d.items():
|
for key, value in d.items():
|
||||||
setattr(obj, key, value)
|
setattr(obj, key, value)
|
||||||
return obj
|
return obj
|
||||||
else:
|
else:
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user