Pages

Thursday, January 1, 2015

Python: overriding static method








class A:
    @staticmethod
    def m():
        print "A"

class B(A):
    @staticmethod
    def m():
        print "B"

a = A()
a.m() # A
b = B()
b.m() # B



No comments:

Post a Comment