Skip to content

Commit 9e55685

Browse files
Docs: alphabetically order sqlite3.Cursor attrs (#96565)
1 parent b126196 commit 9e55685

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

Doc/library/sqlite3.rst

+31-30
Original file line numberDiff line numberDiff line change
@@ -1468,13 +1468,32 @@ Cursor objects
14681468

14691469
Required by the DB-API. Does nothing in :mod:`!sqlite3`.
14701470

1471-
.. attribute:: rowcount
1471+
.. attribute:: arraysize
14721472

1473-
Read-only attribute that provides the number of modified rows for
1474-
``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements;
1475-
is ``-1`` for other statements,
1476-
including :abbr:`CTE (Common Table Expression)` queries.
1477-
It is only updated by the :meth:`execute` and :meth:`executemany` methods.
1473+
Read/write attribute that controls the number of rows returned by :meth:`fetchmany`.
1474+
The default value is 1 which means a single row would be fetched per call.
1475+
1476+
.. attribute:: connection
1477+
1478+
Read-only attribute that provides the SQLite database :class:`Connection`
1479+
belonging to the cursor. A :class:`Cursor` object created by
1480+
calling :meth:`con.cursor() <Connection.cursor>` will have a
1481+
:attr:`connection` attribute that refers to *con*:
1482+
1483+
.. doctest::
1484+
1485+
>>> con = sqlite3.connect(":memory:")
1486+
>>> cur = con.cursor()
1487+
>>> cur.connection == con
1488+
True
1489+
1490+
.. attribute:: description
1491+
1492+
Read-only attribute that provides the column names of the last query. To
1493+
remain compatible with the Python DB API, it returns a 7-tuple for each
1494+
column where the last six items of each tuple are ``None``.
1495+
1496+
It is set for ``SELECT`` statements without any matching rows as well.
14781497

14791498
.. attribute:: lastrowid
14801499

@@ -1491,32 +1510,14 @@ Cursor objects
14911510
.. versionchanged:: 3.6
14921511
Added support for the ``REPLACE`` statement.
14931512

1494-
.. attribute:: arraysize
1495-
1496-
Read/write attribute that controls the number of rows returned by :meth:`fetchmany`.
1497-
The default value is 1 which means a single row would be fetched per call.
1498-
1499-
.. attribute:: description
1500-
1501-
Read-only attribute that provides the column names of the last query. To
1502-
remain compatible with the Python DB API, it returns a 7-tuple for each
1503-
column where the last six items of each tuple are ``None``.
1504-
1505-
It is set for ``SELECT`` statements without any matching rows as well.
1506-
1507-
.. attribute:: connection
1508-
1509-
Read-only attribute that provides the SQLite database :class:`Connection`
1510-
belonging to the cursor. A :class:`Cursor` object created by
1511-
calling :meth:`con.cursor() <Connection.cursor>` will have a
1512-
:attr:`connection` attribute that refers to *con*:
1513+
.. attribute:: rowcount
15131514

1514-
.. doctest::
1515+
Read-only attribute that provides the number of modified rows for
1516+
``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements;
1517+
is ``-1`` for other statements,
1518+
including :abbr:`CTE (Common Table Expression)` queries.
1519+
It is only updated by the :meth:`execute` and :meth:`executemany` methods.
15151520

1516-
>>> con = sqlite3.connect(":memory:")
1517-
>>> cur = con.cursor()
1518-
>>> cur.connection == con
1519-
True
15201521

15211522
.. The sqlite3.Row example used to be a how-to. It has now been incorporated
15221523
into the Row reference. We keep the anchor here in order not to break

0 commit comments

Comments
 (0)