Python中SQLite数据库连接的自动关闭

105 阅读1分钟
conn: Connection
with contextlib.closing(sqlite3.connect(":memory:")) as conn:
    pass