If you intend to refer to class variables within a @staticmethod
, then you end up using the actual name of the enclosing class.
This makes the method un-inheritable only in the cases you refer to the class variables, and the variables happen to be overriden in the subclass - it can still be called
from the derived class / derived class instance. In other words, @staticmethod
s may not behave like proper, polymorphic methods when class variables are overridden.
class Base(object):
class_vars = ['A','B','C']
@staticmethod