8000 docs(docstrings): Add Examples/Returns sections to property aliases · Issue #640 · tmux-python/libtmux · GitHub
[go: up one dir, main page]

Skip to content

docs(docstrings): Add Examples/Returns sections to property aliases #640

@tony

Description

@tony

Summary

Many property aliases across the core ORM classes lack Examples and Returns sections in their docstrings. Adding these would improve API discoverability and provide inline usage documentation.

Affected files

  • src/libtmux/pane.py
  • src/libtmux/window.py
  • src/libtmux/session.py
  • src/libtmux/server.py

What to add

For each property alias (e.g. session_name, window_id, pane_id, etc.):

  1. Returns section — document the return type and what the value represents
  2. Examples section — add a working doctest showing usage with the doctest_namespace fixtures

Example of the desired pattern:

@property
def pane_id(self) -> str | None:
    """Unique pane ID.

    Returns
    -------
    str or None
        Pane ID in the format ``%N``, e.g. ``%0``.

    Examples
    --------
    >>> pane.pane_id  # doctest: +ELLIPSIS
    '%...'
    """

Context

Found during code review of PR #636. This is a documentation-only enhancement with no functional changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0