def __init__(self, app=None, *args, **kwargs): self.db = None if app is not None: self.init_app(app) Connection.__init__(self, *args, **kwargs)