|
|
|
|
|
by albrewer
1704 days ago
|
|
I took a stab at it, there's not enough information to figure out anything more specific: from typing import Callable, Any
def compose(start: Callable[[Any], Any], *args: Callable[[Any], Any] -> Callable[[Any], Any]:
def helper(x: Any) -> Any:
for func in reversed(args):
x = func(x)
return start(x)
return helper
|
|