Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df8caec

Browse files
authored
Update Readme.md
1 parent 0b6036b commit df8caec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- [26 Python的is](#26-python的is)
3838
- [27 read,readline和readlines](#27-readreadline和readlines)
3939
- [28 Python2和3的区别](#28-python2和3的区别)
40+
- [29 super.__init__()](#29-super-init)
4041
- [操作系统](#操作系统)
4142
- [1 select,poll和epoll](#1-selectpoll和epoll)
4243
- [2 调度算法](#2-调度算法)
@@ -659,6 +660,12 @@ is是对比地址,==是对比值
659660
## 28 Python2和3的区别
660661
推荐:[Python 2.7.x 与 Python 3.x 的主要差异](http://chenqx.github.io/2014/11/10/Key-differences-between-Python-2-7-x-and-Python-3-x/)
661662

663+
## 29 super init
664+
super() lets you avoid referring to the base class explicitly, which can be nice. But the main advantage comes with multiple inheritance, where all sorts of fun stuff can happen. See the standard docs on super if you haven't already.
665+
666+
Note that the syntax changed in Python 3.0: you can just say super().__init__() instead of super(ChildB, self).__init__() which IMO is quite a bit nicer.
667+
668+
http://stackoverflow.com/questions/576169/understanding-python-super-with-init-methods
662669

663670
# 操作系统
664671

0 commit comments

Comments
 (0)