Say I want to create a new module to provide encryption/decryption for MySQL. In my module, I might simply have something like this:
import mysqlib
import cryptolib
class SqlEncryption:
def encrypt(foo):
cryptolib.encrypt(foo)
def decrypt(bar)
cryptolib.decrypt(bar)
but of course I could inherit from the crypto and/or sql libs:
class SqliteEncryption(mysqlib, cryptolib):
of course using super
and everything. I usually inherit but this is the first time I've had to wonder if I should inherit from the sql lib, the crypto lib, or both. How should one decide or does it not matter since I'm not actually needing to access anything in those two modules that isn't already exposed in their APIs?