]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document sqlite3.Cursor.close()
authorBerker Peksag <berker.peksag@gmail.com>
Sun, 27 Mar 2016 18:51:02 +0000 (21:51 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Sun, 27 Mar 2016 18:51:02 +0000 (21:51 +0300)
The behaviour of the close method is tested by ClosedCurTests
in Lib/sqlite3/test/dbapi.py.

This is basically a backport of https://github.com/ghaering/pysqlite/issues/73.

Doc/library/sqlite3.rst

index c5a5e818edce351fbb6f9236d18de3683421d7fe..4890fc5d2c518701c1ba7e2098f444ef678cd031 100644 (file)
@@ -593,6 +593,12 @@ Cursor Objects
       the cursor's arraysize attribute can affect the performance of this operation.
       An empty list is returned when no rows are available.
 
+   .. method:: close()
+
+      Close the cursor now (rather than whenever ``__del__`` is called).
+
+      The cursor will be unusable from this point forward; a ``ProgrammingError``
+      exception will be raised if any operation is attempted with the cursor.
 
    .. attribute:: rowcount