Add @type_check_only to stub-only private classes in stdlib (#14512)

This commit is contained in:
Brian Schubert
2025-08-03 10:13:16 +02:00
committed by GitHub
parent dde70aeecd
commit 622df68c1c
61 changed files with 188 additions and 51 deletions
+5
View File
@@ -1,8 +1,10 @@
import sys
from typing import type_check_only
if sys.platform == "win32":
class MSIError(Exception): ...
# Actual typename View, not exposed by the implementation
@type_check_only
class _View:
def Execute(self, params: _Record | None = ...) -> None: ...
def GetColumnInfo(self, kind: int) -> _Record: ...
@@ -14,6 +16,7 @@ if sys.platform == "win32":
__init__: None # type: ignore[assignment]
# Actual typename SummaryInformation, not exposed by the implementation
@type_check_only
class _SummaryInformation:
def GetProperty(self, field: int) -> int | bytes | None: ...
def GetPropertyCount(self) -> int: ...
@@ -24,6 +27,7 @@ if sys.platform == "win32":
__init__: None # type: ignore[assignment]
# Actual typename Database, not exposed by the implementation
@type_check_only
class _Database:
def OpenView(self, sql: str) -> _View: ...
def Commit(self) -> None: ...
@@ -34,6 +38,7 @@ if sys.platform == "win32":
__init__: None # type: ignore[assignment]
# Actual typename Record, not exposed by the implementation
@type_check_only
class _Record:
def GetFieldCount(self) -> int: ...
def GetInteger(self, field: int) -> int: ...