相关疑难解决方法(0)

Python中的类方法差异:绑定,未绑定和静态

以下类方法有什么区别?

是一个是静态而另一个不是?

class Test(object):
  def method_one(self):
    print "Called method_one"

  def method_two():
    print "Called method_two"

a_test = Test()
a_test.method_one()
a_test.method_two()
Run Code Online (Sandbox Code Playgroud)

python

233
推荐指数
4
解决办法
15万
查看次数

标签 统计

python ×1