我有一个未绑定的方法<unbound method foo.ops>,我想与另一个类使用相同的方法.举个例子
class foo2(object):
pass
foo2.ops = foo.ops
Run Code Online (Sandbox Code Playgroud)
然而
obj = foo2()
obj.ops()
raises TypeError: unbound method ops() must be called with foo instance as first argument (got nothing instead)
Run Code Online (Sandbox Code Playgroud)