Python Classes And Object Orientated Design
Since Python v3.3, you can use both the @staticmethod
and @abstractmethod
decorators on the same class function (and the @abstractstaticmethod
decorator has been depreciated).
Checking If A Class Is A Subclass Of Another
You can check if one class is a sub-class of another with the issublass()
function:
Class Variables
In Python, classes can be assigned variables, either statically or dynamically. The important difference between assigning variable to A class and assigning variables to an INSTANCE of a class is that class variables are shared between all variables/instances of that class, while instance variables are unique to that particular instance of the class.