mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-19 22:50:29 +08:00
Mark stub-only private symbols as @type_check_only in third-party stubs (#14545)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Mapping
|
||||
from ssl import SSLContext
|
||||
from typing import Literal, TypedDict
|
||||
from typing import Literal, TypedDict, type_check_only
|
||||
from typing_extensions import NotRequired, deprecated
|
||||
|
||||
import urllib3
|
||||
@@ -38,11 +38,13 @@ from .utils import (
|
||||
)
|
||||
|
||||
# Arguments to urllib3 connection_from_host() functions (except pool_kwargs).
|
||||
@type_check_only
|
||||
class _HostParams(TypedDict):
|
||||
host: str
|
||||
scheme: str
|
||||
port: int
|
||||
|
||||
@type_check_only
|
||||
class _PoolKwargs(TypedDict):
|
||||
ssl_context: NotRequired[SSLContext]
|
||||
ca_certs: NotRequired[str]
|
||||
|
||||
@@ -1,21 +1,27 @@
|
||||
from typing import TypedDict
|
||||
from typing import TypedDict, type_check_only
|
||||
|
||||
@type_check_only
|
||||
class _VersionDict(TypedDict):
|
||||
version: str
|
||||
|
||||
@type_check_only
|
||||
class _OptionalVersionDict(TypedDict):
|
||||
version: str | None
|
||||
|
||||
@type_check_only
|
||||
class _PlatformDict(TypedDict):
|
||||
system: str
|
||||
release: str
|
||||
|
||||
@type_check_only
|
||||
class _ImplementationDict(_VersionDict):
|
||||
name: str
|
||||
|
||||
@type_check_only
|
||||
class _PyOpenSSLDict(_OptionalVersionDict):
|
||||
openssl_version: str
|
||||
|
||||
@type_check_only
|
||||
class _InfoDict(TypedDict):
|
||||
platform: _PlatformDict
|
||||
implementation: _ImplementationDict
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import SupportsItems, SupportsRead, Unused
|
||||
from collections.abc import Callable, Iterable, Mapping, MutableMapping
|
||||
from typing import Any, TypedDict
|
||||
from typing import Any, TypedDict, type_check_only
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
from . import adapters, auth as _auth, compat, cookies, exceptions, hooks, models, status_codes, utils
|
||||
@@ -105,6 +105,7 @@ _HeadersUpdateMapping: TypeAlias = Mapping[str, str | bytes | None]
|
||||
_Timeout: TypeAlias = float | tuple[float, float] | tuple[float, None]
|
||||
_Verify: TypeAlias = bool | str
|
||||
|
||||
@type_check_only
|
||||
class _Settings(TypedDict):
|
||||
verify: _Verify | None
|
||||
proxies: _TextMapping
|
||||
|
||||
Reference in New Issue
Block a user