Skip to content

Commit 48dc780

Browse files
committed
Annotate single_token better
1 parent 82d2f76 commit 48dc780

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

stubs/weasyprint/weasyprint/css/tokens.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import abc
22
from _typeshed import Incomplete
33
from abc import ABC, abstractmethod
44
from collections.abc import Callable, Sequence
5-
from typing import Any, TypeAlias, TypeVar
5+
from typing import Any, Concatenate, ParamSpec, TypeAlias, TypeVar
66

77
_Token: TypeAlias = Any
88
_T = TypeVar("_T")
9+
_P = ParamSpec("_P")
910

1011
ZERO_PERCENT: Incomplete
1112
FIFTY_PERCENT: Incomplete
@@ -55,6 +56,6 @@ def get_target(token, base_url): ...
5556
def get_content_list(tokens, base_url): ...
5657
def get_content_list_token(token, base_url): ...
5758
def single_keyword(function: Callable[[Incomplete], Incomplete]) -> Callable[[Sequence[_Token]], Incomplete | None]: ...
58-
def single_token(function: Callable[[Incomplete], _T]) -> Callable[[Incomplete], _T | None]: ...
59+
def single_token(function: Callable[Concatenate[_Token, _P], _T]) -> Callable[Concatenate[Sequence[_Token], _P], _T | None]: ...
5960
def comma_separated_list(function: Callable[[Incomplete], _T]) -> Callable[[Incomplete], tuple[_T, ...] | None]: ...
6061
def tokenize(item, function=None, unit=None): ...

0 commit comments

Comments
 (0)