From d9e3287d0879cebef1f2b35e49bdb55eaa620ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20O=C4=9Fulcan=20Say=C4=B1n?= <47698920+iosayin@users.noreply.github.com> Date: Tue, 6 Oct 2026 21:36:06 +0300 Subject: [PATCH] refactor(pipeline): use PEP 695 generic function syntax --- other/pipeline.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/other/pipeline.py b/other/pipeline.py index 85a7efbe518c..2e241284df92 100644 --- a/other/pipeline.py +++ b/other/pipeline.py @@ -1,7 +1,5 @@ from collections.abc import Callable, Sequence -from typing import Any, TypeVar - -T = TypeVar("T") +from typing import Any class Pipeline: @@ -33,7 +31,9 @@ def __init__(self, f_ls: Sequence[Callable] | None = None) -> None: def __or__(self, other: Callable) -> "Pipeline": return Pipeline(f_ls=[*self._f_ls, other]) - def __call__(self, input_object: T, f_ls_: Sequence[Callable] | None = None) -> Any: + def __call__[T]( + self, input_object: T, f_ls_: Sequence[Callable] | None = None + ) -> Any: f_ls = f_ls_ or self._f_ls if len(f_ls) == 1: return f_ls[0](input_object)