Skip to content

Commit

Permalink
Expand docstring with link to wikipedia.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 1, 2024
1 parent 36a0d73 commit 860517e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jaraco/functools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ def compose(*funcs):
"""
Compose any number of unary functions into a single unary function.
Comparable to
`function composition <https://en.wikipedia.org/wiki/Function_composition>`_
in mathematics:
``h = g ∘ f`` implies ``h(x) = g(f(x))``.
In Python, ``h = compose(g, f)``.
>>> import textwrap
>>> expected = str.strip(textwrap.dedent(compose.__doc__))
>>> strip_and_dedent = compose(str.strip, textwrap.dedent)
Expand Down

0 comments on commit 860517e

Please sign in to comment.