classmethod

classmethod#

The built-in decorator classmethod allows you to turn a regular method into a class method that can be called either from the class or from instances of the class.

To solve this you may want to learn about descriptors first.