Skip to content

Commit c8c72b3

Browse files
committed
docs(pane): Document deprecated legacy APIs
1 parent 67a46c8 commit c8c72b3

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/libtmux/pane.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,28 @@ def width(self) -> t.Optional[str]:
440440
return self.pane_width
441441

442442
#
443-
# Legacy
443+
# Legacy: Redundant stuff we want to remove
444444
#
445445
def get(self, key: str, default: t.Optional[t.Any] = None) -> t.Any:
446-
""".. deprecated:: 0.16."""
446+
"""Return key-based lookup. Deprecated by attributes.
447+
448+
.. deprecated:: 0.16
449+
450+
Deprecated by attribute lookup.e.g. ``pane['window_name']`` is now
451+
accessed via ``pane.window_name``.
452+
453+
"""
447454
warnings.warn("Pane.get() is deprecated", stacklevel=2)
448455
return getattr(self, key, default)
449456

450457
def __getitem__(self, key: str) -> t.Any:
451-
""".. deprecated:: 0.16."""
458+
"""Return item lookup by key. Deprecated in favor of attributes.
459+
460+
.. deprecated:: 0.16
461+
462+
Deprecated in favor of attributes. e.g. ``pane['window_name']`` is now
463+
accessed via ``pane.window_name``.
464+
465+
"""
452466
warnings.warn(f"Item lookups, e.g. pane['{key}'] is deprecated", stacklevel=2)
453467
return getattr(self, key)

0 commit comments

Comments
 (0)