在python中声明全局函数的方法
class ClassWithGlobalFunction:global spamdef spam(): return 'eggs'def method(self):global montydef monty(): return 'python'
class ClassWithGlobalFunction:
global spam
def spam(): return 'eggs'
def method(self):
global monty
def monty(): return 'python'