From c242aa302a640781bc04bbbdac29f722107ae91c Mon Sep 17 00:00:00 2001 From: finfou Date: Sun, 7 Feb 2016 19:37:52 +0800 Subject: [PATCH] Fix error in json deserialize demo should return obj after setting all attrbutes. --- source/c06/p02_read-write_json_data.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/c06/p02_read-write_json_data.rst b/source/c06/p02_read-write_json_data.rst index 230f8ba..9f0fdd6 100644 --- a/source/c06/p02_read-write_json_data.rst +++ b/source/c06/p02_read-write_json_data.rst @@ -209,7 +209,7 @@ JSON编码的格式对于Python语法而已几乎是完全一样的,除了一 obj = cls.__new__(cls) # Make instance without calling __init__ for key, value in d.items(): setattr(obj, key, value) - return obj + return obj else: return d