Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init_subclass_classmethod_py36.py 313B

12345678910111213141516
  1. # pylint: disable=too-few-public-methods, missing-docstring,no-init
  2. class PluginBase(object):
  3. subclasses = []
  4. def __init_subclass__(cls, **kwargs):
  5. super().__init_subclass__(**kwargs)
  6. cls.subclasses.append(cls)
  7. class Plugin1(PluginBase):
  8. pass
  9. class Plugin2(PluginBase):
  10. pass