Пример #1
0
    def __init_subclass__(cls, **kwargs):
        """Initialize the subclass.

        This checks for all subclasses if they are tagged with :class:`abc.ABC` with :func:`inspect.isabstract`.
        All non-abstract deriving models should have citation information. Subclasses can further override
        ``__init_subclass__``, but need to remember to call ``super().__init_subclass__`` as well so this
        gets run.
        """
        if not inspect.isabstract(cls):
            parse_docdata(cls)
Пример #2
0
 def __init_subclass__(cls, autoreset: bool = True, **kwargs):  # noqa:D105
     cls._is_base_model = not autoreset
     if not cls._is_base_model:
         _add_post_reset_parameters(cls)
         parse_docdata(cls)