当前位置:网站首页>Super (subclass)__ init__ And parent class__ init__ ()
Super (subclass)__ init__ And parent class__ init__ ()
2022-06-11 05:50:00 【Lao Liu selling vegetables at the corner of the street】
'''
super Can refer to parent class .
have access to super Key word call init Method ,
Grammar format :super( Subclass ,self).__init__( Parameters 1, Parameters 2,…)
The effect is equivalent to : Parent class name .__init__(self, Parameters 1, Parameters 2,…)
'''
For example, it is commonly used in aircraft wars :
# pygame.sprite.Sprite.__init__(self) # Call the initial method of the parent class super(Bullet,self).__init__() # The upper and lower levels are the same. They all call the methods of the parent class
These two lines of code are the same
边栏推荐
- [元数据]LinkedIn-DataHub
- "All in one" is a platform to solve all needs, and the era of operation and maintenance monitoring 3.0 has come
- Minimize maximum
- Clojure installation of metabase source code secondary development
- 微信自定义组件---样式--插槽
- SQLite one line SQL implementation updates if there is one, inserts if there is none, multiple conditions, complex conditions
- NDK learning notes (x) POSIX socket for connectionless communication
- Slide the receleview horizontally to the far right to listen to the page loading function
- AltiumDesigner2020导入3D Body-SOLIDWORKS三维模型
- [metadata]linkedin datahub
猜你喜欢

Deep learning distributed training

袋鼠雲數棧基於CBO在Spark SQL優化上的探索

NFC Development -- the method of using NFC mobile phones as access control cards (II)

Getbackgroundaudiomanager controls music playback (dynamic binding of class name)

All questions and answers of database SQL practice niuke.com

NDK R21 compiles ffmpeg 4.2.2+x264 and converts video files using ffmpeg

Start the project using the locally configured gradle

Yonghong Bi product experience (I) data source module

If the MAC fails to connect with MySQL, it will start and report an error

Wechat applet text built-in component newline character does not newline reason
随机推荐
那个酷爱写代码的少年后来怎么样了——走近华为云“瑶光少年”
NDK R21 compiles ffmpeg 4.2.2 (x86, x86_64, armv7, armv8)
SQLite one line SQL implementation updates if there is one, inserts if there is none, multiple conditions, complex conditions
Distributed framework ray - detailed introduction to starting ray and connecting clusters
NLP-D46-nlp比赛D15
Preliminary understanding of multi task learning
Flask develops and implements the like comment module of the online question and answer system
创建酷炫的 CollectionViewCell 转换动画
NFC Development -- utility tools and development documents (IV)
Multithreading tutorial (XXV) atomic array
获取程序exit的值
Reading the registry using batch
What is a thread pool?
Use com youth. banner. Solution to the inflateexception reported by the banner plug-in
Wechat applet text built-in component newline character does not newline reason
NDK learning notes (14) create an avi video player using avilib+window
Handle double quotation mark escape in JSON string
Gilde failed to go to the listener to call back the reason record when loading the Gaussian blur image
Install Oracle Database
NDK learning notes (IX) POSIX sockect connection oriented communication