How can you organize your code to make it easier to change the base class?

You have to define an alias for the base class, assign the real base class to it before your class definition, and use the alias throughout your class. You can also use this method if you want to decide dynamically (e.g., depending on availability of resources) which base class to use.

Example

BaseAlias = <realĀ baseĀ class>
class Derived(BaseAlias):
def meth(self):
BaseAlias.meth(self)