Assume that i have a following 'demo' class:
class demo(object):
class_variable = None
Now whenever some one sets the 'class_variable', i need to validate the value (e.g. class_variable can have only values of type 'str').
demo.class_variable = 15
# here int value is assigned, i want to raise exception for such cases
This can be done for the instance variables by overriding the setattr(self,f,v) method.
How can it be done for the class variables ?