pywin32: Improve some types (#9089)

This commit is contained in:
Samuel T
2022-11-04 20:48:53 -04:00
committed by GitHub
parent 4329404b1c
commit 98dac4c926
9 changed files with 276 additions and 239 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ from _typeshed import Incomplete
from win32com.client import dynamic as dynamic
def GetObject(Pathname: Incomplete | None = ..., Class: Incomplete | None = ..., clsctx: Incomplete | None = ...): ...
def GetObject(Pathname: str | None = ..., Class: Incomplete | None = ..., clsctx: Incomplete | None = ...) -> CDispatch: ...
def GetActiveObject(Class, clsctx=...): ...
def Moniker(Pathname, clsctx=...): ...
def Dispatch(
+4 -2
View File
@@ -1,4 +1,5 @@
from _typeshed import Incomplete
from typing import Any
# Necessary for mypy to not throw AssertionError with win32com.client
class CDispatch:
@@ -22,5 +23,6 @@ class CDispatch:
def __LazyMap__(self, attr): ...
def __AttrToID__(self, attr): ...
ob: Incomplete
def __getattr__(self, attr): ...
def __setattr__(self, attr, value) -> None: ...
# CDispatch objects are dynamically generated and too complex to type
def __getattr__(self, attr: str) -> Any: ...
def __setattr__(self, attr: str, value: Any) -> None: ...