Skip to content

Commit ac005ea

Browse files
[3.10] gh-95273: Align sqlite3 const doc refs with the devguide recommendations (GH-95525). (#95618)
(cherry picked from commit 4d02572) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
1 parent 72e4afd commit ac005ea

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

Doc/library/sqlite3.rst

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,13 @@ Module functions and constants
294294
The :attr:`~Connection.isolation_level` of the connection,
295295
controlling whether and how transactions are implicitly opened.
296296
Can be ``"DEFERRED"`` (default), ``"EXCLUSIVE"`` or ``"IMMEDIATE"``;
297-
or :const:`None` to disable opening transactions implicitly.
297+
or ``None`` to disable opening transactions implicitly.
298298
See :ref:`sqlite3-controlling-transactions` for more.
299-
:type isolation_level: str | :const:`None`
299+
:type isolation_level: str | None
300300

301301
:param check_same_thread:
302-
If :const:`True` (default), only the creating thread may use the connection.
303-
If :const:`False`, the connection may be shared across multiple threads;
302+
If ``True`` (default), only the creating thread may use the connection.
303+
If ``False``, the connection may be shared across multiple threads;
304304
if so, write operations should be serialized by the user to avoid data
305305
corruption.
306306
:type check_same_thread: bool
@@ -317,7 +317,7 @@ Module functions and constants
317317
:type cached_statements: int
318318

319319
:param uri:
320-
If set to :const:`True`, *database* is interpreted as a
320+
If set to ``True``, *database* is interpreted as a
321321
:abbr:`URI (Uniform Resource Identifier)` with a file path
322322
and an optional query string.
323323
The scheme part *must* be ``"file:"``,
@@ -366,7 +366,7 @@ Module functions and constants
366366

367367
.. function:: complete_statement(statement)
368368

369-
Returns :const:`True` if the string *statement* contains one or more complete SQL
369+
Returns ``True`` if the string *statement* contains one or more complete SQL
370370
statements terminated by semicolons. It does not verify that the SQL is
371371
syntactically correct, only that there are no unclosed string literals and the
372372
statement is terminated by a semicolon.
@@ -383,7 +383,7 @@ Module functions and constants
383383
By default you will not get any tracebacks in user-defined functions,
384384
aggregates, converters, authorizer callbacks etc. If you want to debug them,
385385
you can call this function with *flag* set to ``True``. Afterwards, you will
386-
get tracebacks from callbacks on ``sys.stderr``. Use :const:`False` to
386+
get tracebacks from callbacks on ``sys.stderr``. Use ``False`` to
387387
disable the feature again.
388388

389389

@@ -410,7 +410,7 @@ Connection objects
410410

411411
This attribute controls the :ref:`transaction handling
412412
<sqlite3-controlling-transactions>` performed by ``sqlite3``.
413-
If set to :const:`None`, transactions are never implicitly opened.
413+
If set to ``None``, transactions are never implicitly opened.
414414
If set to one of ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"``,
415415
corresponding to the underlying `SQLite transaction behaviour`_,
416416
implicit :ref:`transaction management
@@ -424,8 +424,8 @@ Connection objects
424424
This read-only attribute corresponds to the low-level SQLite
425425
`autocommit mode`_.
426426

427-
:const:`True` if a transaction is active (there are uncommitted changes),
428-
:const:`False` otherwise.
427+
``True`` if a transaction is active (there are uncommitted changes),
428+
``False`` otherwise.
429429

430430
.. versionadded:: 3.2
431431

@@ -488,11 +488,11 @@ Connection objects
488488
A callable that is called when the SQL function is invoked.
489489
The callable must return :ref:`a type natively supported by SQLite
490490
<sqlite3-types>`.
491-
Set to :const:`None` to remove an existing SQL function.
492-
:type func: :term:`callback` | :const:`None`
491+
Set to ``None`` to remove an existing SQL function.
492+
:type func: :term:`callback` | None
493493

494494
:param deterministic:
495-
If :const:`True`, the created SQL function is marked as
495+
If ``True``, the created SQL function is marked as
496496
`deterministic <https://sqlite.org/deterministic.html>`_,
497497
which allows SQLite to perform additional optimizations.
498498
:type deterministic: bool
@@ -531,8 +531,8 @@ Connection objects
531531
The number of arguments that the ``step()`` method must accept
532532
is controlled by *n_arg*.
533533

534-
Set to :const:`None` to remove an existing SQL aggregate function.
535-
:type aggregate_class: :term:`class` | :const:`None`
534+
Set to ``None`` to remove an existing SQL aggregate function.
535+
:type aggregate_class: :term:`class` | None
536536

537537
Example:
538538

@@ -553,7 +553,7 @@ Connection objects
553553

554554
.. literalinclude:: ../includes/sqlite3/collation_reverse.py
555555

556-
Remove a collation function by setting *callable* to :const:`None`.
556+
Remove a collation function by setting *callable* to ``None``.
557557

558558

559559
.. method:: interrupt()
@@ -573,11 +573,11 @@ Connection objects
573573
:mod:`sqlite3` module.
574574

575575
The first argument to the callback signifies what kind of operation is to be
576-
authorized. The second and third argument will be arguments or :const:`None`
576+
authorized. The second and third argument will be arguments or ``None``
577577
depending on the first argument. The 4th argument is the name of the database
578578
("main", "temp", etc.) if applicable. The 5th argument is the name of the
579579
inner-most trigger or view that is responsible for the access attempt or
580-
:const:`None` if this access attempt is directly from input SQL code.
580+
``None`` if this access attempt is directly from input SQL code.
581581

582582
Please consult the SQLite documentation about the possible values for the first
583583
argument and the meaning of the second and third argument depending on the first
@@ -592,7 +592,7 @@ Connection objects
592592
a GUI.
593593

594594
If you want to clear any previously installed progress handler, call the
595-
method with :const:`None` for *progress_handler*.
595+
method with ``None`` for *progress_handler*.
596596

597597
Returning a non-zero value from the handler function will terminate the
598598
currently executing query and cause it to raise an :exc:`OperationalError`
@@ -612,7 +612,7 @@ Connection objects
612612
sqlite3 module and the execution of triggers defined in the current
613613
database.
614614

615-
Passing :const:`None` as *trace_callback* will disable the trace callback.
615+
Passing ``None`` as *trace_callback* will disable the trace callback.
616616

617617
.. note::
618618
Exceptions raised in the trace callback are not propagated. As a
@@ -626,7 +626,7 @@ Connection objects
626626
.. method:: enable_load_extension(enabled, /)
627627

628628
Enable the SQLite engine to load SQLite extensions from shared libraries
629-
if *enabled* is :const:`True`;
629+
if *enabled* is ``True``;
630630
else, disallow loading SQLite extensions.
631631
SQLite extensions can define new functions,
632632
aggregates or whole new virtual table implementations. One well-known
@@ -744,8 +744,8 @@ Connection objects
744744
the *status* of the last iteration,
745745
the *remaining* number of pages still to be copied,
746746
and the *total* number of pages.
747-
Defaults to :const:`None`.
748-
:type progress: :term:`callback` | :const:`None`
747+
Defaults to ``None``.
748+
:type progress: :term:`callback` | None
749749
750750
:param name:
751751
The name of the database to back up.
@@ -825,7 +825,7 @@ Cursor objects
825825
:meth:`executescript` if you want to execute multiple SQL statements with one
826826
call.
827827

828-
If :attr:`~Connection.isolation_level` is not :const:`None`,
828+
If :attr:`~Connection.isolation_level` is not ``None``,
829829
*sql* is an ``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement,
830830
and there is no open transaction,
831831
a transaction is implicitly opened before executing *sql*.
@@ -873,7 +873,7 @@ Cursor objects
873873
.. method:: fetchone()
874874

875875
Fetch the next row of a query result set as a :class:`tuple`.
876-
Return :const:`None` if no more data is available.
876+
Return ``None`` if no more data is available.
877877

878878

879879
.. method:: fetchmany(size=cursor.arraysize)
@@ -929,7 +929,7 @@ Cursor objects
929929
using the :meth:`execute` method. For other statements, after
930930
:meth:`executemany` or :meth:`executescript`, or if the insertion failed,
931931
the value of ``lastrowid`` is left unchanged. The initial value of
932-
``lastrowid`` is :const:`None`.
932+
``lastrowid`` is ``None``.
933933

934934
.. note::
935935
Inserts into ``WITHOUT ROWID`` tables are not recorded.
@@ -946,7 +946,7 @@ Cursor objects
946946

947947
Read-only attribute that provides the column names of the last query. To
948948
remain compatible with the Python DB API, it returns a 7-tuple for each
949-
column where the last six items of each tuple are :const:`None`.
949+
column where the last six items of each tuple are ``None``.
950950

951951
It is set for ``SELECT`` statements without any matching rows as well.
952952

@@ -1107,7 +1107,7 @@ The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`).
11071107

11081108
Exception raised in case a method or database API is not supported by the
11091109
underlying SQLite library. For example, setting *deterministic* to
1110-
:const:`True` in :meth:`~Connection.create_function`, if the underlying SQLite library
1110+
``True`` in :meth:`~Connection.create_function`, if the underlying SQLite library
11111111
does not support deterministic functions.
11121112
``NotSupportedError`` is a subclass of :exc:`DatabaseError`.
11131113

@@ -1125,7 +1125,7 @@ The following Python types can thus be sent to SQLite without any problem:
11251125
+-------------------------------+-------------+
11261126
| Python type | SQLite type |
11271127
+===============================+=============+
1128-
| :const:`None` | ``NULL`` |
1128+
| ``None`` | ``NULL`` |
11291129
+-------------------------------+-------------+
11301130
| :class:`int` | ``INTEGER`` |
11311131
+-------------------------------+-------------+
@@ -1142,7 +1142,7 @@ This is how SQLite types are converted to Python types by default:
11421142
+-------------+----------------------------------------------+
11431143
| SQLite type | Python type |
11441144
+=============+==============================================+
1145-
| ``NULL`` | :const:`None` |
1145+
| ``NULL`` | ``None`` |
11461146
+-------------+----------------------------------------------+
11471147
| ``INTEGER`` | :class:`int` |
11481148
+-------------+----------------------------------------------+
@@ -1428,7 +1428,7 @@ The ``sqlite3`` module does not adhere to the transaction handling recommended
14281428
by :pep:`249`.
14291429

14301430
If the connection attribute :attr:`~Connection.isolation_level`
1431-
is not :const:`None`,
1431+
is not ``None``,
14321432
new transactions are implicitly opened before
14331433
:meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes
14341434
``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements.
@@ -1439,7 +1439,7 @@ that is, whether and what type of ``BEGIN`` statements ``sqlite3``
14391439
implicitly executes –
14401440
via the :attr:`~Connection.isolation_level` attribute.
14411441

1442-
If :attr:`~Connection.isolation_level` is set to :const:`None`,
1442+
If :attr:`~Connection.isolation_level` is set to ``None``,
14431443
no transactions are implicitly opened at all.
14441444
This leaves the underlying SQLite library in `autocommit mode`_,
14451445
but also allows the user to perform their own transaction handling

0 commit comments

Comments
 (0)