Skip to content

Fix error in json deserialize demo #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/c06/p02_read-write_json_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
----------
讨论
----------
在这里列出来的问题是新手很容易犯的错误,有些新手可能会不恰当的lambda表达式
在这里列出来的问题是新手很容易犯的错误,有些新手可能会不恰当的使用lambda表达式
比如,通过在一个循环或列表推导中创建一个lambda表达式列表,并期望函数能在定义时就记住每次的迭代值。例如:

.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion source/c08/p07_calling_method_on_parent_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
>>>

为了弄清它的原理,我们需要花点时间解释下Python是如何实现继承的。
对于你定义的每一个类而已,Python会计算出一个所谓的方法解析顺序(MRO)列表。
对于你定义的每一个类,Python会计算出一个所谓的方法解析顺序(MRO)列表。
这个MRO列表就是一个简单的所有基类的线性顺序表。例如:

.. code-block:: python
Expand Down