GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sqlite3 signature discrepancies between documentation and implementation · Issue #87260 · python/cpython

sqlite3 signature discrepancies between documentation and implementation #87260

New issue
Copy link
New issue
Copy link
Closed
#93840
Closed
sqlite3 signature discrepancies between documentation and implementation#87260
#93840
Copy link
Labels
3.10 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-sqlite3

Description

nchammas
mannequin
opened on Feb 1, 2021
Issue body actions
BPO 43094
Nosy @berkerpeksag, @serhiy-storchaka, @nchammas, @erlend-aasland
PRs
  • bpo-43094: Update sqlite3 docs to match implementation #24489
  • 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:

    assignee = None
    closed_at = None
    created_at = <Date 2021-02-01.20:10:10.173>
    labels = ['3.9', '3.10', 'docs']
    title = 'sqlite3 signature discrepancies between documentation and implementation'
    updated_at = <Date 2021-03-28.21:07:22.364>
    user = 'https://github.com/nchammas'

    bugs.python.org fields:

    activity = <Date 2021-03-28.21:07:22.364>
    actor = 'erlendaasland'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2021-02-01.20:10:10.173>
    creator = 'nchammas'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43094
    keywords = ['patch']
    message_count = 10.0
    messages = ['386100', '386120', '386708', '386741', '386806', '386813', '386826', '389544', '389552', '389651']
    nosy_count = 5.0
    nosy_names = ['docs@python', 'berker.peksag', 'serhiy.storchaka', 'nchammas', 'erlendaasland']
    pr_nums = ['24489']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue43094'
    versions = ['Python 3.9', 'Python 3.10']

    Activity

    Next
    1. nchammas commented on Feb 1, 2021

      @nchammas
      nchammasmannequin
      on Feb 1, 2021
      MannequinAuthor
      More actions

      The doc for sqlite3.create_function shows the signature as follows:

      https://docs.python.org/3.9/library/sqlite3.html#sqlite3.Connection.create_function

      create_function(name, num_params, func, *, deterministic=False)
      

      But it appears that the parameter name is narg, not num_params. Trying num_params yields:

      TypeError: function missing required argument 'narg' (pos 2)
      
    2. nchammas
      added
      3.9 (EOL)end of lifeend of life
      on Feb 1, 2021
    3. nchammas
      assigned
      docspython
      on Feb 1, 2021
    4. nchammas
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      3.9 (EOL)end of lifeend of life
      on Feb 1, 2021
    5. nchammas
      assigned
      docspython
      on Feb 1, 2021
    6. nchammas
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      on Feb 1, 2021
    7. erlend-aasland commented on Feb 1, 2021

      @erlend-aasland
      erlend-aasland
      on Feb 1, 2021
      Contributor
      More actions

      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.

    8. erlend-aasland
      added
      3.10 (EOL)end of lifeend of life
      on Feb 1, 2021
    9. erlend-aasland commented on Feb 9, 2021

      @erlend-aasland
      erlend-aasland
      on Feb 9, 2021
      Contributor
      More actions

      Quoting from Victor Stinner's reply on python-dev (https://mail.python.org/archives/list/[email protected]/message/X6SZIVOZ233TLLJV43UQEHMV3ELGP34S/):

      If there are applications relying on the parameter name, it's better
      to trust the Python implementation, rather than the documentation.

      It would be better to make these parameters positional only in the
      first place, but now it's too late for such backward incompatible
      change :-(

    10. erlend-aasland commented on Feb 9, 2021

      @erlend-aasland
      erlend-aasland
      on Feb 9, 2021
      Contributor
      More actions

      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.

    11. erlend-aasland
      changed the title [-]sqlite3.create_function takes parameter named narg, not num_params[/-] [+]Update sqlite3 docs and docstrings to reflect implementation[/+] on Feb 9, 2021
    12. erlend-aasland
      changed the title [-]sqlite3.create_function takes parameter named narg, not num_params[/-] [+]Update sqlite3 docs and docstrings to reflect implementation[/+] on Feb 9, 2021
    13. erlend-aasland commented on Feb 10, 2021

      @erlend-aasland
      erlend-aasland
      on Feb 10, 2021
      Contributor
      More actions
      sqlite3.Connection.set_progress_handler()

      docs: set_progress_handler(handler, n)
      impl: set_progress_handler(progress_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.

    14. 8 remaining items

    15. erlend-aasland
      added
      topic-sqlite3
      on May 16, 2022
    16. erlend-aasland
      added this to sqlite3 issueson May 21, 2022
    17. erlend-aasland
      moved this to TODO in sqlite3 issueson May 21, 2022
    18. erlend-aasland
      added a commit that references this issue on Jun 15, 2022

      pythongh-87260: Update sqlite3 signature docs to reflect actual imple…

      348b303
    19. erlend-aasland commented on Jun 15, 2022

      @erlend-aasland
      erlend-aasland
      on Jun 15, 2022
      Contributor
      More actions

      The problem is that sqlite3 isn't the only module where there are discrepancies between documentation and implementation.

      This does not stand in the way of fixing the docs right away.

      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.

      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.

    20. erlend-aasland
      closed this as completedin #93840on Jun 15, 2022
    21. Repository owner moved this from TODO: Docs to Done in sqlite3 issueson Jun 15, 2022
    22. erlend-aasland
      added a commit that references this issue on Jun 15, 2022

      gh-87260: Update sqlite3 signature docs to reflect actual implementat…

      d318346
    23. miss-islington
      added 2 commits that reference this issue on Jun 15, 2022

      pythongh-87260: Update sqlite3 signature docs to reflect actual imple…

      e9fac37

      pythongh-87260: Update sqlite3 signature docs to reflect actual imple…

      10b8554
    24. erlend-aasland commented on Jun 15, 2022

      @erlend-aasland
      erlend-aasland
      on Jun 15, 2022
      Contributor
      More actions

      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.

    25. miss-islington
      added 2 commits that reference this issue on Jun 15, 2022

      gh-87260: Update sqlite3 signature docs to reflect actual implementat…

      5285693

      gh-87260: Update sqlite3 signature docs to reflect actual implementat…

      5dee1d8
    26. serhiy-storchaka
      added a commit that references this issue on Jun 26, 2022

      Revert 30935 defer bpo45162 to 312 (#94285)

      1ffde3e
    27. erlend-aasland commented on Aug 22, 2023

      @erlend-aasland
      erlend-aasland
      on Aug 22, 2023
      Contributor
      More actions

      FTR, I did start drafting a PEP back in 2021, but I abandoned the project as I found it to be too vague for a PEP, in my opinion.

      Reacted by Serhiy Storchaka
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-sqlite3

      Projects

      • sqlite3 issues
        Status
        Done
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.