def is_abstract(cls): ABCFLAG = '__abstractmethods__' isabc = hasattr(cls, ABCFLAG) or inspect.isabstract(cls) return isabc