Python入门篇之面向对象

2019-10-05 15:43:57王旭

>>> class TestClassMethod:
    @classmethod
    def foo(cls):
        print 'calling class method foo()'
        print 'foo() is part of class:', cls.__name__