How to make an Abstract Class inherit from another Abstract Class in Python?

Have a look at abc module. For 2.7: link. For 3.6: link Simple example for you: from abc import ABC, abstractmethod class A(ABC): def __init__(self, value): self.value = value super().__init__() @abstractmethod def do_something(self): pass class B(A): @abstractmethod def do_something_else(self): pass class C(B): def do_something(self): pass def do_something_else(self): pass

How do I get the name of the class containing a logging call in Python?

For a rather easy, pythonic way to get the class name to output with your logger, simply use a logging class. import logging # Create a base class class LoggingHandler: def __init__(self, *args, **kwargs): self.log = logging.getLogger(self.__class__.__name__) # Create test class A that inherits the base class class testclassa(LoggingHandler): def testmethod1(self): # call self.log.<log level> … Read more