Skip to content

Update classes.rst #12

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions docs/source/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ Python 同样有限的支持多继承形式。多继承的类定义形如下例:
self.index = len(data)
def __iter__(self):
return self
def __next__(self):
def next(self):
if self.index == 0:
raise StopIteration
self.index = self.index - 1
Expand Down Expand Up @@ -576,4 +576,4 @@ Python 同样有限的支持多继承形式。多继承的类定义形如下例:

.. rubric:: Footnotes

.. [#] 有一个例外。模块对象有一个隐秘的只读对象,名为 :attr:`__dict__` ,它返回用于实现模块命名空间的字典,命名 :attr:`__dict__` 是一个属性而非全局命名。显然,使用它违反了命名空间实现的抽象原则,应该被严格限制于调试中。
.. [#] 有一个例外。模块对象有一个隐秘的只读对象,名为 :attr:`__dict__` ,它返回用于实现模块命名空间的字典,命名 :attr:`__dict__` 是一个属性而非全局命名。显然,使用它违反了命名空间实现的抽象原则,应该被严格限制于调试中。