Skip to content

Commit e6f8814

Browse files
committed
class5
1 parent 6e3c79d commit e6f8814

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

210.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
##调用非绑定方法
2828

29-
[《类(4)](./209.md)中,介绍了一个函数super。为了描述方便,把代码复制过来:
29+
[《类(4)](./209.md)中,介绍了一个函数super。为了描述方便,把代码复制过来:
3030

3131
#!/usr/bin/env python
3232
# coding=utf-8
@@ -163,7 +163,9 @@ staticmethod和classmethod均被作为装饰器,用作定义一个函数为"st
163163
查看代码和图解:
164164

165165
>1/2 参数传递给函数
166+
166167
>3 self参数指向实例本身
168+
167169
>4 我们不需要显式提供实例,解释器本身会处理
168170
169171
假如我们想仅实现类之间交互而不是通过实例?我们可以在类之外建立一个简单的函数来实现这个功能,但是将会使代码扩散到类之外,这个可能对未来代码维护带来问题。

0 commit comments

Comments
 (0)