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 — bisect.bisect is not cross-referenced properly · Issue #104145 · python/cpython

bisect.bisect is not cross-referenced properly #104145

New issue
Copy link
New issue
Copy link
Closed
Closed
bisect.bisect is not cross-referenced properly#104145
Copy link
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@Gobot1234
Gobot1234
opened on May 3, 2023
Issue body actions

Documentation

The documentation page for bisect includes lots of interlinks to the bisect function but it appears that link isn't being resolved correctly by sphinx, whilst it thinks it is a function, it links to the module header

To reproduce: https://docs.python.org/3/library/bisect.html#searching-sorted-lists, click on bisect() and see it take you to the top of the page and not to the function bisect

Linked PRs

  • GH-104145: Use fully-qualified cross reference types for the bisect module #104172
  • [3.11] GH-104145: Use fully-qualified cross reference types for the bisect module (GH-104172) #104295

Activity

  1. Gobot1234
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on May 3, 2023
  2. hauntsaninja
    added
    easy
    on May 4, 2023
  3. Lincoln-developer commented on May 4, 2023

    @Lincoln-developer
    Lincoln-developer
    on May 4, 2023 · Hidden as off-topic
    show commentMore actions
  4. Gobot1234 commented on May 4, 2023

    @Gobot1234
    Gobot1234
    on May 4, 2023 · Hidden as off-topic
    Author
    show commentMore actions
  5. Lincoln-developer commented on May 4, 2023

    @Lincoln-developer
    Lincoln-developer
    on May 4, 2023 · Hidden as off-topic
    show commentMore actions
  6. AA-Turner
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.11only security fixesonly security fixes
    3.12only security fixesonly security fixes
    3.13only security fixesonly security fixes
    on May 4, 2023
  7. AA-Turner commented on May 4, 2023

    @AA-Turner
    AA-Turner
    on May 4, 2023
    Member
    More actions

    James is right, this is an issue in Sphinx. Removing the 'easy' label.

    A

  8. AA-Turner
    removed
    easy
    on May 4, 2023
  9. Lincoln-developer commented on May 4, 2023

    @Lincoln-developer
    Lincoln-developer
    on May 4, 2023 · Hidden as off-topic
    show commentMore actions
  10. AA-Turner commented on May 4, 2023

    @AA-Turner
    AA-Turner
    on May 4, 2023 · Hidden as off-topic
    show commentMore actions
  11. Lincoln-developer commented on May 4, 2023

    @Lincoln-developer
    Lincoln-developer
    on May 4, 2023 · Hidden as off-topic
    show commentMore actions
  12. AA-Turner commented on May 4, 2023

    @AA-Turner
    AA-Turner
    on May 4, 2023
    Member
    More actions

    @Gobot1234 -- the issue is the default cross reference resolution order from Sphinx. See https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#role-py-obj for an explanation, but in essence a standard cross reference role (e.g. :py:func:, :meth:, etc) performs a lookup ignoring the cross-reference type specified. For instance, in our case this means that the :func:`bisect` role here tries to resolve an object with the name bisect first, and succeeds when it finds the reference to the bisect module.

    I'm not sure why cross-reference resolution was implemented with this behaviour, but in the spirit of Chesterton's fence I'm hesitant to change it. It does seem odd though that the explicit type specified is ignored by the resolution machinery: https://github.com/sphinx-doc/sphinx/blob/ba7408209e84ee413f240afc20f3c6b484a81f8f/sphinx/domains/python.py#L1344-L1356

    I'll put up a PR with an (inelegant) fix, but this likely affects the other modules with an eponymous object.

    A

    Reacted by James Hilton-Balfe
  13. AlexWaygood
    added a commit that references this issue on May 8, 2023

    GH-104145: Use fully-qualified cross reference types for the bisect m…

    76eef55
  14. miss-islington
    added a commit that references this issue on May 8, 2023

    pythonGH-104145: Use fully-qualified cross reference types for the bi…

    3e5613c
  15. AlexWaygood
    added a commit that references this issue on May 8, 2023

    [3.11] GH-104145: Use fully-qualified cross reference types for the b…

    8a6ff59
  16. AlexWaygood commented on May 8, 2023

    @AlexWaygood
    AlexWaygood
    on May 8, 2023
    Member
    More actions

    Fixed and backported. Thanks @AA-Turner!

    I'll close this for now; we can open a followup issue if we find other instances of this problem occuring.

    Reacted by Adam Turner
  17. AlexWaygood
    closed this as completedon May 8, 2023
  18. jbower-fb
    added a commit that references this issue on May 8, 2023

    pythonGH-104145: Use fully-qualified cross reference types for the bi…

    a7e9a63
  19. carljm
    added 2 commits that reference this issue on May 9, 2023

    Merge branch 'main' into inlinecomp2

    76077cd

    Merge branch 'main' into fixsendfamily

    a614216
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.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      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.