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

This commit is contained in:
Brian Schubert
2025-08-08 05:29:48 -04:00
committed by GitHub
parent a358dc24e8
commit 81c8fcb2e6
131 changed files with 334 additions and 147 deletions
+9 -1
View File
@@ -1,28 +1,33 @@
from collections.abc import Callable, Iterable, Iterator
from typing import Any, TypedDict, TypeVar
from typing import Any, TypedDict, TypeVar, type_check_only
from typing_extensions import TypeAlias
_T = TypeVar("_T")
_Callback: TypeAlias = Callable[[str, _Result], object]
@type_check_only
class _Result(TypedDict):
nmap: _ResultNmap
scan: dict[str, PortScannerHostDict]
@type_check_only
class _ResultNmap(TypedDict):
command_line: str
scaninfo: _ResultNmapInfo
scanstats: _ResultNampStats
@type_check_only
class _ResultNmapInfo(TypedDict, total=False):
error: str
warning: str
protocol: _ResultNampInfoProtocol
@type_check_only
class _ResultNampInfoProtocol(TypedDict):
method: str
services: str
@type_check_only
class _ResultNampStats(TypedDict):
timestr: str
elapsed: str
@@ -30,14 +35,17 @@ class _ResultNampStats(TypedDict):
downhosts: str
totalhosts: str
@type_check_only
class _ResulHostUptime(TypedDict):
seconds: str
lastboot: str
@type_check_only
class _ResultHostNames(TypedDict):
type: str
name: str
@type_check_only
class _ResultHostPort(TypedDict):
conf: str
cpe: str