Overriding class variables in python
问题 I'm trying to understand a bit how Python (2.6) deals with class, instances and so on, and at a certain point, I tried this code: #/usr/bin/python2.6 class Base(object): default = "default value in base" def __init__(self): super(Base, self).__init__() @classmethod def showDefaultValue(cls, defl = default): print "defl == %s" % (defl) class Descend(Base): default = "default value in descend" def __init__(self): super(Descend, self).__init__() if __name__ == "__main__": Descend