Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62564db

Browse files
committed
#26250: document the sqlite3.Cursor.connection attribute. Initial patches by Aviv Palivoda and Varpu Rantala.
1 parent e4044bf commit 62564db

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/library/sqlite3.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,18 @@ Cursor Objects
627627

628628
It is set for ``SELECT`` statements without any matching rows as well.
629629

630+
.. attribute:: connection
631+
632+
This read-only attribute provides the SQLite database :class:`Connection`
633+
used by the :class:`Cursor` object. A :class:`Cursor` object created by
634+
calling :meth:`con.cursor() <Connection.cursor>` will have a
635+
:attr:`connection` attribute that refers to *con*::
636+
637+
>>> con = sqlite3.connect(":memory:")
638+
>>> cur = con.cursor()
639+
>>> cur.connection == con
640+
True
641+
630642
.. _sqlite3-row-objects:
631643

632644
Row Objects

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ Burton Radons
11731173
Abhilash Raj
11741174
Shorya Raj
11751175
Jeff Ramnani
1176+
Varpu Rantala
11761177
Brodie Rao
11771178
Senko Rasic
11781179
Antti Rasinen

0 commit comments

Comments
 (0)