Skip to content

Docs: add links to 'callable' term in sqlite3 docs #106072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,15 @@ Module functions

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

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

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

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

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

* Access is allowed (:const:`!SQLITE_OK`),
Expand Down Expand Up @@ -629,8 +629,8 @@ Connection objects

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

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

Expand Down Expand Up @@ -723,7 +723,7 @@ Connection objects
If ``-1``, it may take any number of arguments.

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

.. method:: set_authorizer(authorizer_callback)

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

Expand All @@ -970,7 +971,7 @@ Connection objects

.. method:: set_progress_handler(progress_handler, n)

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

.. method:: set_trace_callback(trace_callback)

Register callable *trace_callback* to be invoked for each SQL statement
that is actually executed by the SQLite backend.
Register :term:`callable` *trace_callback* to be invoked
for each SQL statement that is actually executed by the SQLite backend.

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

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

.. attribute:: text_factory

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