Skip to content

bug: Closing parenthesis missing for PEP 695 type parameters with docstring_section_style: list #349

Closed

Description

@vadzimk

Description of the bug

When a PEP 695 generic class has a Type parameters: docstring section and docstring_section_style is set to list, the closing parenthesis after each type parameter's bound is missing from the rendered page.

The output is TId (Hashable – Type of the entity identifier. instead of TId (Hashable) – Type of the entity identifier.. The generated HTML also does not contain the ). Switching to docstring_section_style: table renders all three type parameters correctly, so the bug appears to be in the list section template.

To Reproduce

Configuration (mkdocs.yml):

plugins:
  - mkdocstrings:
      handlers:
        python:
          options:
            docstring_style: google
            docstring_section_style: list
            show_signature: true
            show_signature_annotations: true

Module:

class Entity[TId: Hashable, M: Snapshot, S: State]:
    """An entity.

    Type parameters:
        TId (Hashable): Type of the entity identifier.
        M (Snapshot): Snapshot type returned by to_snapshot().
        S (State): Internal state type that holds internal mutable data.
    """

Steps:

  1. Use the configuration and module above.
  2. Add ::: module.Entity to a Markdown page.
  3. Run mkdocs build and open the generated page.
  4. Look at the Type parameters section. The closing ) is missing after each bound.

Removing griffe_typingdoc from the extensions and renaming the heading to Type Parameters: do not change the output.

Full traceback

No traceback. The build completes without errors or warnings.

Expected behavior

Each type parameter is shown with its bound in parentheses, for example TId (Hashable) – Type of the entity identifier.

Environment information

python -m mkdocstrings_handlers.python._internal.debug

  • System: macOS-14.7.2-x86_64-...
  • Python: cpython 3.13.9 (.../.venv/bin/python)
  • Environment variables:
  • Installed packages:
    • mkdocstrings-python v2.0.10

OUTPUT

Class Type Parameters:

TId (Hashable– Type of the entity identifier.
M (Snapshot– Snapshot type returned by to_snapshot().
S (State– Internal state type that holds internal mutable data.

Additional context

Versions: mkdocstrings-python 2.0.10, griffelib 2.4.1, griffe not installed.

The table layout output for the same class is:

Name Bound or Constraints Description Default
TId Hashable Type of the entity identifier. required
M Snapshot Snapshot type returned by to_snapshot(). required
S State Internal state type that holds internal mutable data. required

Activity

  1. vadzimk commented on Nov 11, 2026

    @vadzimk
    Author

    Related to #221

  2. pawamoy commented on Nov 12, 2026

    @pawamoy
    Member

    Thanks for the report @vadzimk, fixed in ecfd54d 🙂

  3. added
    bugSomething isn't working
    and removed
    unconfirmedThis bug was not reproduced yet
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions