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
sqlite3 signature discrepancies between documentation and implementation #87260
Comments
The doc for sqlite3.create_function shows the signature as follows: https://docs.python.org/3.9/library/sqlite3.html#sqlite3.Connection.create_function
But it appears that the parameter name is
|
There's also a discrepancy between the docs and the signature for create_aggregate(): https://docs.python.org/3.9/library/sqlite3.html#sqlite3.Connection.create_aggregate create_aggregate(name, num_params, aggregate_class) The second parameter is named n_arg, here with an underscore. I'm not sure what's the best fix; fixing the docs or the signatures. If we fix the signatures, we'll at least get a kind of consistency. |
Quoting from Victor Stinner's reply on python-dev (https://mail.python.org/archives/list/python-dev@python.org/message/X6SZIVOZ233TLLJV43UQEHMV3ELGP34S/): If there are applications relying on the parameter name, it's better It would be better to make these parameters positional only in the |
Module level function discrepancies: register_converter(), register_adapter(), and enable_callback_tracebacks() docstrings were unintentionally altered in recent AC updates. Docstrings should be restored. Docs are ok. adapt() is not documented, but docstrings were unintentionally altered in recent AC updates. Docstrings should be restored. connect() and enable_shared_cache() (latter is undocumented) are ok. complete_statement() docs should be updated to reflect implementation. |
sqlite3.Connection.set_progress_handler() docs: set_progress_handler(handler, n) Apart from that, the rest of sqlite3.Connection seems to be ok. There's an ongoing discussion at python-dev about how to resolve this issue. I'm in favour of normalising the create_*() methods to be positional only (like create_collation() is now). sqlite3.Cursor and sqlite3.Row methods seems to be ok as well. |
The problem is that sqlite3 isn't the only module where there are discrepancies between documentation and implementation. If we are going to change public sqlite3 APIs in to be positional-only, I'd prefer writing a PEP and fix all modules once and for all. |
Right. I assume you mean that such a PEP would contain a set of guidelines for how to handle these dilemmas? It would be almost impossible to create a set of strict rules that can handle all cases, AFAICS. |
Berker, I started drafting a PEP. Would you be interested in helping? |
Of course! I may be not be able to respond to you quickly in the next few weeks, though. |
Thank you! I'll send you a preliminary version sometime this week. |
This does not stand in the way of fixing the docs right away.
I think that is too large for a PEP. We could create an issue for making some sqlite3 methods positional only. See also gh-93057. |
…ion (#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()
…mentation (pythonGH-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>
…mentation (pythonGH-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>
Thanks for the report. If there are further discrepancies, please open a new issue. For making sqlite3 methods positional only, please open a new issue. |
…ion (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>
…ion (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>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: