Let's say that you have the following code:
import sqlite3
conn = sqlite3.connect('mydb')
cur = conn.cursor()
# some database actions
cur.close()
conn.close()
# more code below
If I try to use the conn
or cur
objects later on, how could I tell that they are closed? I cannot find a .isclosed()
method or anything like it.