class Midi: def __init__(self, device_id=None): # detect os and pick a class to use self.cls = SimpleMidiWin32(device_id=device_id) def __getattr__(self, attr): return getattr(self.cls, attr)