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,6 +1,6 @@
from abc import ABCMeta, abstractmethod
from collections.abc import Mapping
from typing import Any, Generic, TypeVar
from typing import Any, Generic, TypeVar, type_check_only
from typing_extensions import Self
from requests import Response, Session
@@ -50,6 +50,7 @@ class Adapter(Generic[_R], metaclass=ABCMeta):
self, method, url: str, headers: Mapping[str, str] | None = None, raise_exception: bool = True, **kwargs: Any
) -> _R: ...
@type_check_only
class _GenericRawAdapter(Adapter[_R]):
def get_login_token(self, response: _R) -> str: ...
def request(
+2 -1
View File
@@ -1,7 +1,8 @@
from collections.abc import Callable, Iterable, Mapping
from typing import Any, NoReturn, TypedDict, TypeVar
from typing import Any, NoReturn, TypedDict, TypeVar, type_check_only
from typing_extensions import NotRequired
@type_check_only
class _DeprecateProperty(TypedDict):
to_be_removed_in_version: str
client_property: str