uranusjr opened a new pull request, #25088: URL: https://github.com/apache/airflow/pull/25088
I want to use them in some @task signature improvements. Mypy added this in 0.950, but let's just bump to latest since why not. Changelog of typing-extensions is spotty before 4.0, but ParamSpec was introduced some time before that (likely some time in 2021), and it seems to be a reasonble minimum to bump to. See [PEP 612](https://peps.python.org/pep-0612/) for more about ParamSpec if you’re interested. But in short, it solves our problem when typing `@task`—the resulting task should accept the same arguments as the wrapped function inside, but when called should return an XComArg, instead of the wrapped function’s return value. ```python # This is a Callable[[int, str], str] def foo(a: int, b: str) -> str: return b * a # How can we type the wrapped task as Callable[[int, str] XComArg]? # ParamSpec makes this possible. @task def foo(a: int, b: str) -> str: return b * a ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
