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

Aperta
#640 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Review the property aliases in src/libtmux/pane.py, src/libtmux/window.py, src/libtmux/session.py, and src/libtmux/server.py, using the existing doctest_namespace fixtures as the usage context. For each alias, document its return type and value, then add a working doctest in the requested Examples and Returns sections. Done means all affected aliases have both sections and the doctests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
1.2k
Fork
127
Merge medio
2h 13m
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tmux-python/libtmux

Tutte le issue di tmux-python/libtmux

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.