Skip to content

refactor(task): Improve task decorator type inference#113

Merged
CCXLV merged 2 commits into
mainfrom
better-type-hints
Feb 20, 2026
Merged

refactor(task): Improve task decorator type inference#113
CCXLV merged 2 commits into
mainfrom
better-type-hints

Conversation

@CCXLV

@CCXLV CCXLV commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Now the task function with return types other than None will throw static type errors like this basedpyright error:

Argument of type "() -> int" cannot be assigned to parameter "func" of type "(**P@decorator) -> Coroutine[Any, Any, None]" in function "decorator"

And task functions that have return type hint other than None will throw TypeError:

@fluxqueue.task()  
def test_task() -> int:  # <- TypeError
    pass

@CCXLV CCXLV changed the title refactor(types): improve task decorator type inference refactor(task): Improve task decorator type inference Feb 20, 2026
@CCXLV CCXLV merged commit 3b3222d into main Feb 20, 2026
14 checks passed
@CCXLV CCXLV deleted the better-type-hints branch February 20, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant