复制代码def MethodType(func, instance): return types.MethodType(func, instance, type(instance)) # don't override system execfile on 2.x: