PYTHON
Python Classes And Object Orientated Design
Article by:Geoffrey Hunter
Date Published: | |
Last Modified: |
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).
|
|
You have to make sure to specify
@staticmethod
before @abstractmethod
or it will not work.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.
|
|
Authors

This work is licensed under a Creative Commons Attribution 4.0 International License .