Skip to content

Commit f930bee

Browse files
[3.12] Docs: add links to 'callable' term in sqlite3 docs (GH-106072) (#106073)
(cherry picked from commit bef1c87) Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent 9cd3664 commit f930bee

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

Doc/library/sqlite3.rst

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,15 @@ Module functions
413413

414414
.. function:: register_adapter(type, adapter, /)
415415

416-
Register an *adapter* callable to adapt the Python type *type* into an
417-
SQLite type.
416+
Register an *adapter* :term:`callable` to adapt the Python type *type*
417+
into an SQLite type.
418418
The adapter is called with a Python object of type *type* as its sole
419419
argument, and must return a value of a
420420
:ref:`type that SQLite natively understands <sqlite3-types>`.
421421

422422
.. function:: register_converter(typename, converter, /)
423423

424-
Register the *converter* callable to convert SQLite objects of type
424+
Register the *converter* :term:`callable` to convert SQLite objects of type
425425
*typename* into a Python object of a specific type.
426426
The converter is invoked for all SQLite values of type *typename*;
427427
it is passed a :class:`bytes` object and should return an object of the
@@ -484,7 +484,7 @@ Module constants
484484
SQLITE_DENY
485485
SQLITE_IGNORE
486486

487-
Flags that should be returned by the *authorizer_callback* callable
487+
Flags that should be returned by the *authorizer_callback* :term:`callable`
488488
passed to :meth:`Connection.set_authorizer`, to indicate whether:
489489

490490
* Access is allowed (:const:`!SQLITE_OK`),
@@ -629,8 +629,8 @@ Connection objects
629629

630630
Create and return a :class:`Cursor` object.
631631
The cursor method accepts a single optional parameter *factory*. If
632-
supplied, this must be a callable returning an instance of :class:`Cursor`
633-
or its subclasses.
632+
supplied, this must be a :term:`callable` returning
633+
an instance of :class:`Cursor` or its subclasses.
634634

635635
.. method:: blobopen(table, column, row, /, *, readonly=False, name="main")
636636

@@ -723,7 +723,7 @@ Connection objects
723723
If ``-1``, it may take any number of arguments.
724724

725725
:param func:
726-
A callable that is called when the SQL function is invoked.
726+
A :term:`callable` that is called when the SQL function is invoked.
727727
The callable must return :ref:`a type natively supported by SQLite
728728
<sqlite3-types>`.
729729
Set to ``None`` to remove an existing SQL function.
@@ -948,9 +948,10 @@ Connection objects
948948

949949
.. method:: set_authorizer(authorizer_callback)
950950

951-
Register callable *authorizer_callback* to be invoked for each attempt to
952-
access a column of a table in the database. The callback should return
953-
one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE`
951+
Register :term:`callable` *authorizer_callback* to be invoked
952+
for each attempt to access a column of a table in the database.
953+
The callback should return one of :const:`SQLITE_OK`,
954+
:const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE`
954955
to signal how access to the column should be handled
955956
by the underlying SQLite library.
956957

@@ -973,7 +974,7 @@ Connection objects
973974

974975
.. method:: set_progress_handler(progress_handler, n)
975976

976-
Register callable *progress_handler* to be invoked for every *n*
977+
Register :term:`callable` *progress_handler* to be invoked for every *n*
977978
instructions of the SQLite virtual machine. This is useful if you want to
978979
get called from SQLite during long-running operations, for example to update
979980
a GUI.
@@ -988,8 +989,8 @@ Connection objects
988989

989990
.. method:: set_trace_callback(trace_callback)
990991

991-
Register callable *trace_callback* to be invoked for each SQL statement
992-
that is actually executed by the SQLite backend.
992+
Register :term:`callable` *trace_callback* to be invoked
993+
for each SQL statement that is actually executed by the SQLite backend.
993994

994995
The only argument passed to the callback is the statement (as
995996
:class:`str`) that is being executed. The return value of the callback is
@@ -1139,8 +1140,8 @@ Connection objects
11391140
Defaults to ``-1``.
11401141

11411142
:param progress:
1142-
If set to a callable, it is invoked with three integer arguments for
1143-
every backup iteration:
1143+
If set to a :term:`callable`,
1144+
it is invoked with three integer arguments for every backup iteration:
11441145
the *status* of the last iteration,
11451146
the *remaining* number of pages still to be copied,
11461147
and the *total* number of pages.
@@ -1404,8 +1405,8 @@ Connection objects
14041405

14051406
.. attribute:: text_factory
14061407

1407-
A callable that accepts a :class:`bytes` parameter and returns a text
1408-
representation of it.
1408+
A :term:`callable` that accepts a :class:`bytes` parameter
1409+
and returns a text representation of it.
14091410
The callable is invoked for SQLite values with the ``TEXT`` data type.
14101411
By default, this attribute is set to :class:`str`.
14111412
If you want to return ``bytes`` instead, set *text_factory* to ``bytes``.

0 commit comments

Comments
 (0)