只需
drop()针对表对象调用。从文档:
使用给定的Connectable进行连接,为此表发出DROP语句。
在您的情况下,应为:
User.__table__.drop()
如果出现类似以下的异常:
sqlalchemy.exc.UnboundExecutionError: Table object 'my_users' is notbound to an Engine or Connection. Execution can not proceed without a
database to execute against
您需要传递引擎:
User.__table__.drop(engine)



