Skip to content

Ref target labels for except/except*/finally not located precisely #95975

Description

@CAM-Gerlach

As originally noticed by @ezio-melotti on #95937 , the ref target labels for the except, except* and finally keywords are located at the top of the [try statement section in the Compound Statements][(https://docs.python.org/3.11/reference/compound_stmts.html#the-try-statement) reference; however, they are actually discussed at specific points sometimes several pages down in the lengthy section. Therefore, the targets should be moved to more precise locations immediately prior to the introduction of the relevant keyword.

It would also be nice to make the section either to navigate with sub sections rather than one big long section, but that is considered outside the immediate scope of this proximate issue. It turns out this is required to get :keyword: to work, and the section is already organized by clause, so it makes sense just to add them.

Activity

  1. self-assigned this
    on Aug 14, 2022
  2. added 2 commits that reference this issue on Aug 14, 2022
  3. CAM-Gerlach commented on Aug 14, 2022

    @CAM-Gerlach
    MemberAuthor

    The plot thickens—for no obvious reason, it seems :keyword: simply won't work with ref target labels that don't precede a section header (or at least some named object), which is presumably why they were put there in the first place. However, given it would make navigating what has become a quite long section easier, and requires no textual changes given the section is already strongly organized by clause type, I can just add the appropriate subsection headers to fix this, given it improves both internal and external navigation.

  4. CAM-Gerlach commented on Aug 14, 2022

    @CAM-Gerlach
    MemberAuthor

    @najmiehsa Sorry, I already submitted #95976 — it ended up being not as trivial as I thought in any case.

  5. added a commit that references this issue on Oct 2, 2022
  6. added 2 commits that reference this issue on Oct 2, 2022
  7. added a commit that references this issue on Oct 2, 2022
  8. added a commit that references this issue on Oct 3, 2022
  9. added a commit that references this issue on Oct 22, 2022
  10. hauntsaninja commented on Sep 7, 2023

    @hauntsaninja
    Contributor

    Thanks all!

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

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dir

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions