Mark stub-only private symbols as @type_check_only in third-party stubs (#14545)

This commit is contained in:
Brian Schubert
2025-08-08 11:29:48 +02:00
committed by GitHub
parent a358dc24e8
commit 81c8fcb2e6
131 changed files with 334 additions and 147 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
from typing import Literal, TypedDict
from typing import Literal, TypedDict, type_check_only
from typing_extensions import NotRequired, TypeAlias
_NodeType: TypeAlias = Literal[
@@ -26,6 +26,7 @@ _NodeType: TypeAlias = Literal[
"value_projection",
]
@type_check_only
class _ASTNode(TypedDict):
type: _NodeType
children: list[_ASTNode]
+2 -1
View File
@@ -1,10 +1,11 @@
from collections.abc import Callable, Iterable
from typing import Any, TypedDict, TypeVar
from typing import Any, TypedDict, TypeVar, type_check_only
from typing_extensions import NotRequired
TYPES_MAP: dict[str, str]
REVERSE_TYPES_MAP: dict[str, tuple[str, ...]]
@type_check_only
class _Signature(TypedDict):
types: list[str]
variadic: NotRequired[bool]
+2 -1
View File
@@ -1,8 +1,9 @@
from collections.abc import Iterator
from typing import ClassVar, TypedDict
from typing import ClassVar, TypedDict, type_check_only
from jmespath.exceptions import EmptyExpressionError as EmptyExpressionError, LexerError as LexerError
@type_check_only
class _LexerTokenizeResult(TypedDict):
type: str
value: str
+2 -1
View File
@@ -1,6 +1,6 @@
from _typeshed import Unused
from collections.abc import Callable, MutableMapping
from typing import Any, ClassVar, NoReturn, TypedDict, TypeVar
from typing import Any, ClassVar, NoReturn, TypedDict, TypeVar, type_check_only
from jmespath.functions import Functions
@@ -27,6 +27,7 @@ class Visitor:
def visit(self, node: _TreeNode, *args: Any, **kwargs: Any) -> Any: ...
def default_visit(self, node: _TreeNode, *args: Unused, **kwargs: Unused) -> NoReturn: ...
@type_check_only
class _TreeNode(TypedDict):
type: str
value: Any