From: Berker Peksag Date: Sun, 27 Mar 2016 18:51:02 +0000 (+0300) Subject: Document sqlite3.Cursor.close() X-Git-Tag: v3.6.0a1~313^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f70fe6f6cfde596264ed6fdd626b8c2964443f3e;p=thirdparty%2FPython%2Fcpython.git Document sqlite3.Cursor.close() 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. --- diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index c5a5e818edce..4890fc5d2c51 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -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