可能重复:
python'self'解释
对于这个例子:
class HelloWorld:
def index(self):
return "Hello world!"
Run Code Online (Sandbox Code Playgroud)
将self始终传递给函数.什么是self,为什么需要一直传递给函数/方法?谢谢.
| 归档时间: |
|
| 查看次数: |
372 次 |
| 最近记录: |