Various pywin32 improvements (#11616)

This commit is contained in:
Avasam
2024-03-30 14:55:30 -04:00
committed by GitHub
parent 9d2f651818
commit f36714b0fb
14 changed files with 110 additions and 80 deletions

View File

@@ -1,5 +1,6 @@
from _typeshed import Incomplete
import _win32typing
from win32com.server import policy as policy
from win32com.server.exception import COMException as COMException
@@ -32,9 +33,9 @@ def NewCollection(seq, cls=...): ...
class FileStream:
file: Incomplete
def __init__(self, file) -> None: ...
def __init__(self, file: _win32typing.Pymmapfile) -> None: ...
def Read(self, amount): ...
def Write(self, data): ...
def Clone(self): ...
def CopyTo(self, dest, cb): ...
def Seek(self, offset, origin): ...
def Seek(self, offset: int, origin: int) -> int: ...

View File

@@ -1,8 +1,16 @@
from _typeshed import Incomplete
from collections.abc import Callable
from typing_extensions import TypeAlias
from pythoncom import com_error as com_error
from win32com.client import gencache as gencache
# Type of pythoncom._univgw.WriteFromOutTuple
# The two tuples must be of equal length
_WriteFromOutTupleType: TypeAlias = Callable[
[tuple[Incomplete, ...] | None, tuple[Incomplete, ...] | None, int], Incomplete | None
]
def RegisterInterfaces(typelibGUID, lcid, major, minor, interface_names: Incomplete | None = ...): ...
class Arg:
@@ -24,4 +32,4 @@ class Definition:
def iid(self): ...
def vtbl_argsizes(self): ...
def vtbl_argcounts(self): ...
def dispatch(self, ob, index, argPtr, ReadFromInTuple=..., WriteFromOutTuple=...): ...
def dispatch(self, ob, index, argPtr, ReadFromInTuple=..., WriteFromOutTuple: _WriteFromOutTupleType = ...): ...