Skip to content

Commit 82d2f76

Browse files
committed
Add minimally more decorator annotations
1 parent 35d2001 commit 82d2f76

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

stubs/weasyprint/weasyprint/css/tokens.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ 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
5+
from typing import Any, TypeAlias, TypeVar
66

77
_Token: TypeAlias = Any
8+
_T = TypeVar("_T")
89

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

0 commit comments

Comments
 (0)