-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The progress_task decorator in tipi/core/permanences.py returns Callable[..., Callable[..., Any]], which causes mypy to report no-any-return errors when using it.
Currently we have # type: ignore[no-any-return] comments in tipi/core/processes.py (lines 113, 134, 155) to suppress these warnings.
Proposed Solution
Update progress_task to use TypeVar and ParamSpec for proper generic typing:
from typing import TypeVar, ParamSpec
P = ParamSpec("P")
R = TypeVar("R")
def progress_task(self, task_name: str, visible: bool = True) -> Callable[[Callable[P, R]], Callable[[int], R]]:
...This would:
- Preserve the decorated function's return type
- Eliminate the need for
type: ignorecomments - Provide better IDE support and type checking
Files Affected
[permanences.py] - Update decorator signature
[processes.py] - Remove [type: ignore] comments after fix
Additional Context
A [ProgressTaskCallable] Protocol was added to document the expected interface:
This can potentially be removed or repurposed once the decorator is properly typed.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request