8000 fix(logging[doctest]): add doctest to _identity · tmux-python/tmuxp@16fb89a · GitHub
[go: up one dir, main page]

Skip to content

Commit 16fb89a

Browse files
committed
fix(logging[doctest]): add doctest to _identity
why: All functions must have working doctests per project conventions. what: - Add Examples section with string and integer pass-through tests
1 parent 9ee0acc commit 16fb89a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/tmuxp/_compat.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,22 @@
1111

1212

1313
def _identity(x: object) -> object:
14-
"""Return *x* unchanged — used as a no-op decorator."""
14+
"""Return *x* unchanged — used as a no-op decorator.
15+
16+
Examples
17+
--------
18+
>>> from tmuxp._compat import _identity
19+
20+
Strings pass through unchanged:
21+
22+
>>> _identity("hello")
23+
'hello'
24+
25+
Integers pass through unchanged:
26+
27+
>>> _identity(42)
28+
42
29+
"""
1530
return x
1631

1732

0 commit comments

Comments
 (0)
0