Skip to content

Commit 5285693

Browse files
gh-87260: Update sqlite3 signature docs to reflect actual implementation (GH-93840)
Align the docs for the following methods with the actual implementation: - sqlite3.complete_statement() - sqlite3.Connection.create_function() - sqlite3.Connection.create_aggregate() - sqlite3.Connection.set_progress_handler() (cherry picked from commit d318346) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
1 parent 9775ac3 commit 5285693

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Doc/library/sqlite3.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ Module functions and constants
326326
float, str or bytes.
327327

328328

329-
.. function:: complete_statement(sql)
329+
.. function:: complete_statement(statement)
330330

331-
Returns :const:`True` if the string *sql* contains one or more complete SQL
331+
Returns :const:`True` if the string *statement* contains one or more complete SQL
332332
statements terminated by semicolons. It does not verify that the SQL is
333333
syntactically correct, only that there are no unclosed string literals and the
334334
statement is terminated by a semicolon.
@@ -447,11 +447,11 @@ Connection Objects
447447
:meth:`~Cursor.executescript` on it with the given *sql_script*.
448448
Return the new cursor object.
449449

450-
.. method:: create_function(name, num_params, func, *, deterministic=False)
450+
.. method:: create_function(name, narg, func, *, deterministic=False)
451451

452452
Creates a user-defined function that you can later use from within SQL
453-
statements under the function name *name*. *num_params* is the number of
454-
parameters the function accepts (if *num_params* is -1, the function may
453+
statements under the function name *name*. *narg* is the number of
454+
parameters the function accepts (if *narg* is -1, the function may
455455
take any number of arguments), and *func* is a Python callable that is
456456
called as the SQL function. If *deterministic* is true, the created function
457457
is marked as `deterministic <https://sqlite.org/deterministic.html>`_, which
@@ -470,12 +470,12 @@ Connection Objects
470470
.. literalinclude:: ../includes/sqlite3/md5func.py
471471

472472

473-
.. method:: create_aggregate(name, num_params, aggregate_class)
473+
.. method:: create_aggregate(name, n_arg, aggregate_class)
474474

475475
Creates a user-defined aggregate function.
476476

477477
The aggregate class must implement a ``step`` method, which accepts the number
478-
of parameters *num_params* (if *num_params* is -1, the function may take
478+
of parameters *n_arg* (if *n_arg* is -1, the function may take
479479
any number of arguments), and a ``finalize`` method which will return the
480480
final result of the aggregate.
481481

@@ -570,15 +570,15 @@ Connection Objects
570570
Added support for disabling the authorizer using :const:`None`.
571571

572572

573-
.. method:: set_progress_handler(handler, n)
573+
.. method:: set_progress_handler(progress_handler, n)
574574

575575
This routine registers a callback. The callback is invoked for every *n*
576576
instructions of the SQLite virtual machine. This is useful if you want to
577577
get called from SQLite during long-running operations, for example to update
578578
a GUI.
579579

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

583583
Returning a non-zero value from the handler function will terminate the
584584
currently executing query and cause it to raise an :exc:`OperationalError`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Align :mod:`sqlite3` argument specs with the actual implementation.

0 commit comments

Comments
 (0)