可能重复:
python ‘self’ explained
Why do you need explicitly have the “self” argument into a Python method?为什么Python需要“self”参数?
为什么Python的需要方法的 “自我” 参数?
例如def method_abc(self, arg1)
而且是有过一个日期,需要将被删除?
可能重复:
python ‘self’ explained
Why do you need explicitly have the “self” argument into a Python method?为什么Python需要“self”参数?
为什么Python的需要方法的 “自我” 参数?
例如def method_abc(self, arg1)
而且是有过一个日期,需要将被删除?
对于确定指向当前对象的名称的建议是什么? – 2010-08-16 01:20:04
另请参阅:http://stackoverflow.com/questions/1984104,http://stackoverflow.com/questions/68282/,http://stackoverflow.com/questions/475871/,http://neopythonic.blogspot。 com/2008/10/why-explicit-self-has-to-stay.html – sdcvvc 2010-08-16 01:22:43
@Anon,“this” - 就像在Java中一样,不需要定义就可以存在。 – TeddyB 2010-08-16 01:42:14