Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d318346

Browse filesBrowse files
gh-87260: Update sqlite3 signature docs to reflect actual implementation (#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()
1 parent 7e9eaad commit d318346
Copy full SHA for d318346

File tree

Expand file treeCollapse file tree

2 files changed

+10
-9
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-9
lines changed

‎Doc/library/sqlite3.rst

Copy file name to clipboardExpand all lines: Doc/library/sqlite3.rst
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ Module functions and constants
336336
float, str or bytes.
337337

338338

339-
.. function:: complete_statement(sql)
339+
.. function:: complete_statement(statement)
340340

341-
Returns :const:`True` if the string *sql* contains one or more complete SQL
341+
Returns :const:`True` if the string *statement* contains one or more complete SQL
342342
statements terminated by semicolons. It does not verify that the SQL is
343343
syntactically correct, only that there are no unclosed string literals and the
344344
statement is terminated by a semicolon.
@@ -457,11 +457,11 @@ Connection Objects
457457
:meth:`~Cursor.executescript` on it with the given *sql_script*.
458458
Return the new cursor object.
459459

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

462462
Creates a user-defined function that you can later use from within SQL
463-
statements under the function name *name*. *num_params* is the number of
464-
parameters the function accepts (if *num_params* is -1, the function may
463+
statements under the function name *name*. *narg* is the number of
464+
parameters the function accepts (if *narg* is -1, the function may
465465
take any number of arguments), and *func* is a Python callable that is
466466
called as the SQL function. If *deterministic* is true, the created function
467467
is marked as `deterministic <https://sqlite.org/deterministic.html>`_, which
@@ -480,12 +480,12 @@ Connection Objects
480480
.. literalinclude:: ../includes/sqlite3/md5func.py
481481

482482

483-
.. method:: create_aggregate(name, num_params, aggregate_class)
483+
.. method:: create_aggregate(name, n_arg, aggregate_class)
484484

485485
Creates a user-defined aggregate function.
486486

487487
The aggregate class must implement a ``step`` method, which accepts the number
488-
of parameters *num_params* (if *num_params* is -1, the function may take
488+
of parameters *n_arg* (if *n_arg* is -1, the function may take
489489
any number of arguments), and a ``finalize`` method which will return the
490490
final result of the aggregate.
491491

@@ -580,15 +580,15 @@ Connection Objects
580580
Added support for disabling the authorizer using :const:`None`.
581581

582582

583-
.. method:: set_progress_handler(handler, n)
583+
.. method:: set_progress_handler(progress_handler, n)
584584

585585
This routine registers a callback. The callback is invoked for every *n*
586586
instructions of the SQLite virtual machine. This is useful if you want to
587587
get called from SQLite during long-running operations, for example to update
588588
a GUI.
589589

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

593593
Returning a non-zero value from the handler function will terminate the
594594
currently executing query and cause it to raise a :exc:`DatabaseError`
+1Lines changed: 1 addition & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.