From 7bab7005dca4dc824464d0bcfa1fa85eac3fa62f Mon Sep 17 00:00:00 2001 From: Anerdw Date: Tue, 18 Aug 2026 00:05:02 -0500 Subject: [PATCH] feat: add an example return type to the Concatenate solution --- challenges/extreme-concatenate/solution.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/challenges/extreme-concatenate/solution.py b/challenges/extreme-concatenate/solution.py index 4860cd9..a022bda 100644 --- a/challenges/extreme-concatenate/solution.py +++ b/challenges/extreme-concatenate/solution.py @@ -8,14 +8,21 @@ to transform `foo` into the function you want. """ -from typing import Concatenate, Callable, Any +from typing import Concatenate, Callable, Any, Protocol class Person: pass -def transform[T, **P](f: Callable[Concatenate[Any, P], T]): +# Not required to pass the tests +class Transformed[T, **P](Protocol): + def __call__(self, value: Person, *args: P.args, **kwargs: P.kwargs) -> T: + ... + + +# Omitting the return type still passes tests +def transform[T, **P](f: Callable[Concatenate[Any, P], T]) -> Transformed[T, P]: def wrapper(value: Person, *args: P.args, **kwargs: P.kwargs) -> T: return f(value, *args, **kwargs)