title: Is there a "with conn.cursor() as..." way to work with Sqlite?
body: <p>Instead of using:</p>
  
  <pre><code>import sqlite3
  conn = sqlite3.connect(':memory:')
  c = conn.cursor()
  c.execute(...)
  c.close()
  </code></pre>
  
  <p>would it be possible to use the Pythonic idiom:</p>
  
  <pre><code>with conn.cursor() as c:
      c.execute(...)
  </code></pre>
  
  <p>It doesn't seem to work:</p>
  
  <pre><code>AttributeError: __exit__
  </code></pre>
  
  <p>Note: it's important to close a cursor because of <a href="https://stackoverflow.com/questions/53270520/how-to-know-which-process-is-responsible-for-a-operationalerror-database-is-lo/53470118#53470118">this</a>.</p>