python中绑定的方法和绑定方法究竟是什么?对象创建时它有什么不同?什么是python中的绑定和非绑定方法
我是新手到Python我写了这一小段代码
class newclass:
def function1(self,var2):
self.var2=var2
print var2
self.fun_var=var2
newobject = newclass
newobject.function1(64)
我喜欢这个
Traceback (most recent call last):
File "basic_class.py", line 8, in <module>
newobject.function1(64)
TypeError: unbound method function1() must be called with newclass instance as first argument (got int instance instead)
究竟是什么绑定的方法和不受约束的方法在Python得到错误