[Python-checkins] gh-87260: Update sqlite3 signature docs to reflect actual implementation (GH-93840)

miss-islington webhook-mailer at python.org
Wed Jun 15 06:46:46 EDT 2022


https://github.com/python/cpython/commit/5dee1d840cefff2f4b81a89519ec7385e13dd72a
commit: 5dee1d840cefff2f4b81a89519ec7385e13dd72a
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-06-15T03:46:33-07:00
summary:

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 d31834688bccb41fc136f780db83ffa12bef8cbd)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland at protonmail.com>

files:
A Misc/NEWS.d/next/Documentation/2022-06-15-12-12-49.gh-issue-87260.epyI7D.rst
M Doc/library/sqlite3.rst

diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index f1d0426728e7e..959a2599b1111 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -308,9 +308,9 @@ Module functions and constants
    float, str or bytes.
 
 
-.. function:: complete_statement(sql)
+.. function:: complete_statement(statement)
 
-   Returns :const:`True` if the string *sql* contains one or more complete SQL
+   Returns :const:`True` if the string *statement* contains one or more complete SQL
    statements terminated by semicolons. It does not verify that the SQL is
    syntactically correct, only that there are no unclosed string literals and the
    statement is terminated by a semicolon.
@@ -394,11 +394,11 @@ Connection Objects
       :meth:`~Cursor.executescript` on it with the given *sql_script*.
       Return the new cursor object.
 
-   .. method:: create_function(name, num_params, func, *, deterministic=False)
+   .. method:: create_function(name, narg, func, *, deterministic=False)
 
       Creates a user-defined function that you can later use from within SQL
-      statements under the function name *name*. *num_params* is the number of
-      parameters the function accepts (if *num_params* is -1, the function may
+      statements under the function name *name*. *narg* is the number of
+      parameters the function accepts (if *narg* is -1, the function may
       take any number of arguments), and *func* is a Python callable that is
       called as the SQL function. If *deterministic* is true, the created function
       is marked as `deterministic <https://sqlite.org/deterministic.html>`_, which
@@ -417,12 +417,12 @@ Connection Objects
       .. literalinclude:: ../includes/sqlite3/md5func.py
 
 
-   .. method:: create_aggregate(name, num_params, aggregate_class)
+   .. method:: create_aggregate(name, n_arg, aggregate_class)
 
       Creates a user-defined aggregate function.
 
       The aggregate class must implement a ``step`` method, which accepts the number
-      of parameters *num_params* (if *num_params* is -1, the function may take
+      of parameters *n_arg* (if *n_arg* is -1, the function may take
       any number of arguments), and a ``finalize`` method which will return the
       final result of the aggregate.
 
@@ -479,7 +479,7 @@ Connection Objects
       one. All necessary constants are available in the :mod:`sqlite3` module.
 
 
-   .. method:: set_progress_handler(handler, n)
+   .. method:: set_progress_handler(progress_handler, n)
 
       This routine registers a callback. The callback is invoked for every *n*
       instructions of the SQLite virtual machine. This is useful if you want to
@@ -487,7 +487,7 @@ Connection Objects
       a GUI.
 
       If you want to clear any previously installed progress handler, call the
-      method with :const:`None` for *handler*.
+      method with :const:`None` for *progress_handler*.
 
       Returning a non-zero value from the handler function will terminate the
       currently executing query and cause it to raise an :exc:`OperationalError`
diff --git a/Misc/NEWS.d/next/Documentation/2022-06-15-12-12-49.gh-issue-87260.epyI7D.rst b/Misc/NEWS.d/next/Documentation/2022-06-15-12-12-49.gh-issue-87260.epyI7D.rst
new file mode 100644
index 0000000000000..4c6cee86ca115
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2022-06-15-12-12-49.gh-issue-87260.epyI7D.rst
@@ -0,0 +1 @@
+Align :mod:`sqlite3` argument specs with the actual implementation.



More information about the Python-checkins mailing list