diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-03-27 19:39:41 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-03-27 19:39:41 (GMT) |
commit | f841909f092e4c7e17f1673cc7f0d9b535542a60 (patch) | |
tree | 062b600efdae8c2ef91c00f76b4a5c26aeb47f25 /Doc | |
parent | b61b0f13b5b88f500d3be053a5e25fc167fd6ebd (diff) | |
parent | fa0f62d6ab3d4acf949bd0160bca16f0f973c323 (diff) | |
download | cpython-f841909f092e4c7e17f1673cc7f0d9b535542a60.zip cpython-f841909f092e4c7e17f1673cc7f0d9b535542a60.tar.gz cpython-f841909f092e4c7e17f1673cc7f0d9b535542a60.tar.bz2 |
Issue #23758: Improve num_params docs of create_{function,aggregate} functions
If you pass -1, the callable can take any number of arguments.
Added tests to verify the behavior.
Initial patch by Cédric Krier.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/sqlite3.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 4890fc5..b037b45 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -324,8 +324,9 @@ Connection Objects 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, and *func* is a Python callable that is called - as the SQL function. + parameters the function accepts (if *num_params* is -1, the function may + take any number of arguments), and *func* is a Python callable that is + called as the SQL function. The function can return any of the types supported by SQLite: bytes, str, int, float and None. @@ -340,7 +341,8 @@ Connection Objects Creates a user-defined aggregate function. The aggregate class must implement a ``step`` method, which accepts the number - of parameters *num_params*, and a ``finalize`` method which will return the + of parameters *num_params* (if *num_params* is -1, the function may take + any number of arguments), and a ``finalize`` method which will return the final result of the aggregate. The ``finalize`` method can return any of the types supported by SQLite: |