From 860517ec815feb00e5cbae4462c852ecc1d3e833 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 8 Jul 2024 14:18:59 -0400 Subject: [PATCH] Expand docstring with link to wikipedia. --- jaraco/functools/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jaraco/functools/__init__.py b/jaraco/functools/__init__.py index ca6c22f..d66f1af 100644 --- a/jaraco/functools/__init__.py +++ b/jaraco/functools/__init__.py @@ -14,6 +14,14 @@ def compose(*funcs): """ Compose any number of unary functions into a single unary function. + Comparable to + `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)