mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Fix invoke task decorator (#7511)
The decorator can be called with and without (). The current types only consider the first case
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Any, TypeVar
|
||||
from typing import Any, TypeVar, overload
|
||||
|
||||
from .config import Config
|
||||
from .context import Context
|
||||
@@ -55,6 +55,9 @@ class Task:
|
||||
def arg_opts(self, name: str, default: Any, taken_names: Iterable[str]) -> dict[str, Any]: ...
|
||||
def get_arguments(self) -> list[Argument]: ...
|
||||
|
||||
@overload
|
||||
def task(__func: Callable[..., Any]) -> Task: ...
|
||||
@overload
|
||||
def task(
|
||||
*args: Task,
|
||||
name: str | None = ...,
|
||||
|
||||
Reference in New Issue
Block a user