Skip to content

Commit e60f518

Browse files
committed
Remove _GoodDispatchTypes TypeAlias
1 parent 0943e0f commit e60f518

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

stubs/pywin32/win32com/client/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from typing_extensions import TypeAlias
55

66
import _win32typing
77
from pythoncom import com_record
8+
from win32.lib.pywintypes import IIDType
89
from win32com.client import dynamic
910

1011
_Stringifiable: TypeAlias = object
@@ -13,7 +14,7 @@ def GetObject(Pathname: str | None = None, Class=None, clsctx=None) -> CDispatch
1314
def GetActiveObject(Class: str, clsctx=...): ...
1415
def Moniker(Pathname: str, clsctx=...): ...
1516
def Dispatch(
16-
dispatch: str | dynamic.PyIDispatchType | dynamic._GoodDispatchTypes | dynamic.PyIUnknownType,
17+
dispatch: str | dynamic.PyIDispatchType | IIDType | dynamic.PyIUnknownType,
1718
userName: str | None = None,
1819
resultCLSID: _Stringifiable | None = None,
1920
typeinfo: _win32typing.PyITypeInfo | None = None,

stubs/pywin32/win32com/client/dynamic.pyi

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from _typeshed import Incomplete
22
from typing import Any, Final, Literal, Protocol, TypeVar, overload, type_check_only
3-
from typing_extensions import TypeAlias
43

54
import _win32typing
65
from win32.lib.pywintypes import IIDType
@@ -13,7 +12,7 @@ _T = TypeVar("_T")
1312
class _DispatchCreateClass(Protocol[_T_co]):
1413
@staticmethod
1514
def __call__(
16-
IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType,
15+
IDispatch: str | PyIDispatchType | IIDType | PyIUnknownType,
1716
olerepr: build.DispatchItem | build.LazyDispatchItem,
1817
userName: str | None = None,
1918
lazydata=None,
@@ -31,19 +30,17 @@ def debug_attr_print(*args: object) -> None: ...
3130
PyIDispatchType = _win32typing.PyIDispatch
3231
PyIUnknownType = _win32typing.PyIUnknown
3332

34-
_GoodDispatchTypes: TypeAlias = str | IIDType
35-
3633
@overload
3734
def Dispatch(
38-
IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType,
35+
IDispatch: str | PyIDispatchType | IIDType | PyIUnknownType,
3936
userName: str | None,
4037
createClass: _DispatchCreateClass[_T],
4138
typeinfo: _win32typing.PyITypeInfo | None = None,
4239
clsctx: int = ...,
4340
) -> _T: ...
4441
@overload
4542
def Dispatch(
46-
IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType,
43+
IDispatch: str | PyIDispatchType | IIDType | PyIUnknownType,
4744
userName: str | None = None,
4845
createClass: None = None,
4946
typeinfo: _win32typing.PyITypeInfo | None = None,

stubs/pywin32/win32com/client/gencache.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ from contextlib import contextmanager
44
from types import ModuleType
55
from typing import Literal, NoReturn
66

7+
from win32.lib.pywintypes import IIDType
78
from win32com.client import dynamic
89

910
bForDemandDefault: int
@@ -37,7 +38,7 @@ def MakeModuleForTypelib(
3738
bBuildHidden: bool | Literal[0, 1] = 1,
3839
) -> ModuleType: ...
3940
def MakeModuleForTypelibInterface(
40-
typelib_ob, progressInstance=None, bForDemand: Unused = ..., bBuildHidden: bool | Literal[0, 1] = 1
41+
typelib_ob, progressInstance=None, bForDemand: bool | Literal[0, 1] = ..., bBuildHidden: bool | Literal[0, 1] = 1
4142
) -> ModuleType | None: ...
4243
def EnsureModuleForTypelibInterface(
4344
typelib_ob, progressInstance=None, bForDemand: bool | Literal[0, 1] = ..., bBuildHidden: bool | Literal[0, 1] = 1
@@ -54,8 +55,7 @@ def EnsureModule(
5455
bBuildHidden: bool | Literal[0, 1] = 1,
5556
) -> ModuleType | None: ...
5657
def EnsureDispatch(
57-
prog_id: str | dynamic.PyIDispatchType | dynamic._GoodDispatchTypes | dynamic.PyIUnknownType,
58-
bForDemand: bool | Literal[0, 1] = 1,
58+
prog_id: str | dynamic.PyIDispatchType | IIDType | dynamic.PyIUnknownType, bForDemand: bool | Literal[0, 1] = 1
5959
) -> dynamic.CDispatch: ...
6060
def AddModuleToCache(typelibclsid, lcid, major, minor, verbose: Unused = 1, bFlushNow: bool | Literal[0, 1] = ...) -> None: ...
6161
def GetGeneratedInfos() -> list[tuple[Incomplete, Incomplete, Incomplete, Incomplete]]: ...

0 commit comments

Comments
 (0)