Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/libtmux/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,25 @@ class PaneDirection(enum.Enum):


class _DefaultOptionScope:
# Sentinel value for default scope
...
"""Sentinel type for the ``scope=`` parameter's default value.

The lone instance :data:`DEFAULT_OPTION_SCOPE` is used as the
default for option-related helpers; receiving methods use ``is``
comparison against the sentinel to detect "no explicit scope was
passed" and infer the right scope from the bound object type.
"""


DEFAULT_OPTION_SCOPE: _DefaultOptionScope = _DefaultOptionScope()
"""Sentinel default for ``scope=`` parameters on option / hook helpers.

When ``scope is DEFAULT_OPTION_SCOPE`` the caller hasn't selected an
explicit :class:`OptionScope`; the receiving method
(:meth:`Pane._show_option`, :meth:`Server.show_options`, etc.)
infers the appropriate scope from the bound object type
(``Pane`` → ``OptionScope.Pane``, ``Server`` → ``OptionScope.Server``,
…).
"""


class OptionScope(enum.Enum):
Expand Down
Loading