procrastinate-org / procrastinate

PostgreSQL-based Task Queue for Python
https://procrastinate.readthedocs.io/
MIT License
800 stars 52 forks source link

The task decorator lacks type hints #1056

Closed onlyann closed 1 month ago

onlyann commented 2 months ago

The task decorator is annotated to return Any. This makes it harder to discover the API as no autocomplete and type check is offered by the editor.

Fortunately, the function description and the overall documentation make up quite well for it.

I think it would still be nice to get improved type annotations for the decorator.

If this is something you are interested in, I can offer to contribute.

ewjoachim commented 2 months ago

Ah, good idea. With ParamSpec, we should be able to have full specification.

Sadly, we can't yet use PEP 695 syntax because we need to support older python, but we can use the most modern syntax that is supported with from __future__ import annotations so feel free :)