Skip to content

Commit bef1c87

Browse files
Docs: add links to 'callable' term in sqlite3 docs (#106072)
1 parent 19d6511 commit bef1c87

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.
@@ -945,9 +945,10 @@ Connection objects
945945

946946
.. method:: set_authorizer(authorizer_callback)
947947

948-
Register callable *authorizer_callback* to be invoked for each attempt to
949-
access a column of a table in the database. The callback should return
950-
one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE`
948+
Register :term:`callable` *authorizer_callback* to be invoked
949+
for each attempt to access a column of a table in the database.
950+
The callback should return one of :const:`SQLITE_OK`,
951+
:const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE`
951952
to signal how access to the column should be handled
952953
by the underlying SQLite library.
953954

@@ -970,7 +971,7 @@ Connection objects
970971

971972
.. method:: set_progress_handler(progress_handler, n)
972973

973-
Register callable *progress_handler* to be invoked for every *n*
974+
Register :term:`callable` *progress_handler* to be invoked for every *n*
974975
instructions of the SQLite virtual machine. This is useful if you want to
975976
get called from SQLite during long-running operations, for example to update
976977
a GUI.
@@ -985,8 +986,8 @@ Connection objects
985986

986987
.. method:: set_trace_callback(trace_callback)
987988

988-
Register callable *trace_callback* to be invoked for each SQL statement
989-
that is actually executed by the SQLite backend.
989+
Register :term:`callable` *trace_callback* to be invoked
990+
for each SQL statement that is actually executed by the SQLite backend.
990991

991992
The only argument passed to the callback is the statement (as
992993
:class:`str`) that is being executed. The return value of the callback is
@@ -1136,8 +1137,8 @@ Connection objects
11361137
Defaults to ``-1``.
11371138

11381139
:param progress:
1139-
If set to a callable, it is invoked with three integer arguments for
1140-
every backup iteration:
1140+
If set to a :term:`callable`,
1141+
it is invoked with three integer arguments for every backup iteration:
11411142
the *status* of the last iteration,
11421143
the *remaining* number of pages still to be copied,
11431144
and the *total* number of pages.
@@ -1401,8 +1402,8 @@ Connection objects
14011402

14021403
.. attribute:: text_factory
14031404

1404-
A callable that accepts a :class:`bytes` parameter and returns a text
1405-
representation of it.
1405+
A :term:`callable` that accepts a :class:`bytes` parameter
1406+
and returns a text representation of it.
14061407
The callable is invoked for SQLite values with the ``TEXT`` data type.
14071408
By default, this attribute is set to :class:`str`.
14081409
If you want to return ``bytes`` instead, set *text_factory* to ``bytes``.

0 commit comments

Comments
 (0)