From d72bc4e7a2d71b4e4654268e770c68dc28e09845 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 27 Oct 2022 19:38:14 -0700 Subject: [PATCH 1/2] _msi: improve types --- stdlib/_msi.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/_msi.pyi b/stdlib/_msi.pyi index 9dda8a598549..ec61f737fa7b 100644 --- a/stdlib/_msi.pyi +++ b/stdlib/_msi.pyi @@ -12,11 +12,11 @@ if sys.platform == "win32": # Don't exist at runtime __new__: None # type: ignore[assignment] __init__: None # type: ignore[assignment] - # Actual typename Summary, not exposed by the implementation - class _Summary: - def GetProperty(self, propid: int) -> str | bytes | None: ... + # Actual typename SummaryInformation, not exposed by the implementation + class _SummaryInformation: + def GetProperty(self, field: int) -> int | bytes | None: ... def GetPropertyCount(self) -> int: ... - def SetProperty(self, propid: int, value: str | bytes) -> None: ... + def SetProperty(self, field: int, value: int | bytes) -> None: ... def Persist(self) -> None: ... # Don't exist at runtime __new__: None # type: ignore[assignment] @@ -25,7 +25,7 @@ if sys.platform == "win32": class _Database: def OpenView(self, sql: str) -> _View: ... def Commit(self) -> None: ... - def GetSummaryInformation(self, updateCount: int) -> _Summary: ... + def GetSummaryInformation(self, updateCount: int) -> _SummaryInformation: ... def Close(self) -> None: ... # Don't exist at runtime __new__: None # type: ignore[assignment] From 4824aee40ace1d9af22c67c8336d211f52dd06eb Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 28 Oct 2022 06:13:36 -0700 Subject: [PATCH 2/2] Update stdlib/_msi.pyi Co-authored-by: Sebastian Rittau --- stdlib/_msi.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/_msi.pyi b/stdlib/_msi.pyi index ec61f737fa7b..1b86904d5ebc 100644 --- a/stdlib/_msi.pyi +++ b/stdlib/_msi.pyi @@ -16,7 +16,7 @@ if sys.platform == "win32": class _SummaryInformation: def GetProperty(self, field: int) -> int | bytes | None: ... def GetPropertyCount(self) -> int: ... - def SetProperty(self, field: int, value: int | bytes) -> None: ... + def SetProperty(self, field: int, value: int | str) -> None: ... def Persist(self) -> None: ... # Don't exist at runtime __new__: None # type: ignore[assignment]