-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[pywin32] Improve win32com #15527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[pywin32] Improve win32com #15527
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
275984b
[pywin32] Improve win32com
donbarbos 9cbb0e6
fix errors
donbarbos fc1af20
add suggestions and try to remove dynamic entry
donbarbos 300503e
ignore error
donbarbos 8e38cd6
pretend _GoodDispatchTypes is Union
donbarbos d21a4f0
forgot to remove allowlist entry to see result of pretending
donbarbos c0f4c67
update again
donbarbos 34147ba
Annotate gencache
donbarbos 4730227
Use Union for _GoodDispatchTypes
donbarbos 0943e0f
add missing function
donbarbos e60f518
Remove _GoodDispatchTypes TypeAlias
donbarbos e5592a9
update allowlist
donbarbos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,70 @@ | ||
| from _typeshed import Incomplete | ||
| from collections.abc import Iterable | ||
| from typing import ClassVar, Final, Literal | ||
|
|
||
| class NotSupportedException(Exception): ... | ||
|
|
||
| DropIndirection: Final = "DropIndirection" | ||
| NoTranslateTypes: Final[list[int]] | ||
| NoTranslateMap: Final[set[int]] | ||
|
|
||
| class MapEntry: | ||
| dispid: Incomplete | ||
| desc: Incomplete | None | ||
| names: Incomplete | ||
| doc: Incomplete | ||
| resultCLSID: Incomplete | ||
| resultDocumentation: Incomplete | None | ||
| wasProperty: Incomplete | ||
| hidden: bool | Literal[0, 1] | ||
| def __init__( | ||
| self, desc_or_id, names=None, doc=None, resultCLSID=..., resultDoc=None, hidden: bool | Literal[0, 1] = 0 | ||
| ) -> None: ... | ||
| def GetResultCLSID(self) -> Incomplete | None: ... | ||
| def GetResultCLSIDStr(self) -> str: ... | ||
| def GetResultName(self) -> Incomplete | None: ... | ||
|
|
||
| class OleItem: | ||
| typename: str | ||
| typename: ClassVar[str] | ||
| doc: Incomplete | ||
| python_name: Incomplete | ||
| bWritten: int | ||
| bIsDispatch: int | ||
| bIsSink: int | ||
| clsid: Incomplete | ||
| co_class: Incomplete | ||
| def __init__(self, doc: Incomplete | None = ...) -> None: ... | ||
| python_name: Incomplete | None | ||
| bWritten: bool | Literal[0, 1] | ||
| bIsDispatch: bool | Literal[0, 1] | ||
| bIsSink: bool | Literal[0, 1] | ||
| clsid: Incomplete | None | ||
| co_class: Incomplete | None | ||
| def __init__(self, doc=None) -> None: ... | ||
|
|
||
| class DispatchItem(OleItem): | ||
| typename: str | ||
| propMap: Incomplete | ||
| propMapGet: Incomplete | ||
| propMapPut: Incomplete | ||
| mapFuncs: Incomplete | ||
| defaultDispatchName: Incomplete | ||
| hidden: int | ||
| def __init__( | ||
| self, typeinfo: Incomplete | None = ..., attr: Incomplete | None = ..., doc: Incomplete | None = ..., bForUser: int = ... | ||
| ) -> None: ... | ||
| typename: ClassVar[str] | ||
| propMap: dict[Incomplete, Incomplete] | ||
| propMapGet: dict[Incomplete, Incomplete] | ||
| propMapPut: dict[Incomplete, Incomplete] | ||
| mapFuncs: dict[Incomplete, Incomplete] | ||
| defaultDispatchName: Incomplete | None | ||
| hidden: bool | Literal[0, 1] | ||
| def __init__(self, typeinfo=None, attr=None, doc=None, bForUser: bool | Literal[0, 1] = 1) -> None: ... | ||
| clsid: Incomplete | ||
| bIsDispatch: Incomplete | ||
| def Build(self, typeinfo, attr, bForUser: int = ...) -> None: ... | ||
| def CountInOutOptArgs(self, argTuple): ... | ||
| def MakeFuncMethod(self, entry, name, bMakeClass: int = ...): ... | ||
| def MakeDispatchFuncMethod(self, entry, name, bMakeClass: int = ...): ... | ||
| def MakeVarArgsFuncMethod(self, entry, name, bMakeClass: int = ...): ... | ||
| bIsDispatch: bool | Literal[0, 1] | ||
| def Build(self, typeinfo, attr, bForUser: bool | Literal[0, 1] = 1) -> None: ... | ||
| def CountInOutOptArgs(self, argTuple: Iterable[Incomplete]) -> tuple[int, int, int]: ... | ||
| def MakeFuncMethod(self, entry, name: str, bMakeClass: bool | Literal[0, 1] = 1) -> list[str]: ... | ||
| def MakeDispatchFuncMethod(self, entry, name: str, bMakeClass: bool | Literal[0, 1] = 1) -> list[str]: ... | ||
| def MakeVarArgsFuncMethod(self, entry, name: str, bMakeClass: bool | Literal[0, 1] = 1) -> list[str]: ... | ||
|
|
||
| class VTableItem(DispatchItem): | ||
| vtableFuncs: list[tuple[Incomplete, Incomplete, Incomplete]] | ||
| def Build(self, typeinfo, attr, bForUser: bool | Literal[0, 1] = 1) -> None: ... | ||
|
|
||
| class LazyDispatchItem(DispatchItem): | ||
| typename: str | ||
| typename: ClassVar[str] | ||
| clsid: Incomplete | ||
| def __init__(self, attr, doc) -> None: ... | ||
|
|
||
| typeSubstMap: Final[dict[int, int]] | ||
| valid_identifier_chars: Final[str] | ||
|
|
||
| def demunge_leading_underscores(className: str) -> str: ... | ||
| def MakePublicAttributeName(className: str, is_global: bool = False) -> str: ... | ||
| def MakeDefaultArgRepr(defArgVal) -> str | None: ... | ||
| def BuildCallList(fdesc, names, defNamedOptArg, defNamedNotOptArg, defUnnamedArg, defOutArg, is_comment: bool = False) -> str: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,63 @@ | ||
| from _typeshed import Incomplete, Unused | ||
| from collections.abc import Generator | ||
| from contextlib import contextmanager | ||
| from types import ModuleType | ||
| from typing import Literal, NoReturn | ||
|
|
||
| from win32.lib.pywintypes import IIDType | ||
| from win32com.client import dynamic | ||
|
|
||
| bForDemandDefault: int | ||
| clsidToTypelib: dict[str, tuple[str, int, int, int]] | ||
| versionRedirectMap: dict[tuple[str, int, int, int], ModuleType | None] | ||
| is_readonly: bool | ||
| is_zip: bool | ||
| demandGeneratedTypeLibraries: dict[tuple[str, int, int, int], Incomplete] | ||
|
|
||
| def __init__() -> None: ... | ||
|
|
||
| pickleVersion: int | ||
|
|
||
| @contextmanager | ||
| def ModuleMutex(module_name: str) -> Generator[None]: ... | ||
| def GetGeneratedFileName(clsid, lcid, major, minor) -> str: ... | ||
| def SplitGeneratedFileName(fname: str) -> tuple[str, ...]: ... | ||
| def GetGeneratePath() -> str: ... | ||
| def GetClassForProgID(progid: str) -> type | None: ... | ||
| def GetClassForCLSID(clsid) -> type | None: ... | ||
| def GetModuleForProgID(progid: str) -> ModuleType | None: ... | ||
| def GetModuleForCLSID(clsid) -> ModuleType | None: ... | ||
| def GetModuleForTypelib(typelibCLSID, lcid, major, minor) -> ModuleType: ... | ||
| def MakeModuleForTypelib( | ||
| typelibCLSID, | ||
| lcid, | ||
| major, | ||
| minor, | ||
| progressInstance=None, | ||
| bForDemand: bool | Literal[0, 1] = ..., | ||
| bBuildHidden: bool | Literal[0, 1] = 1, | ||
| ) -> ModuleType: ... | ||
| def MakeModuleForTypelibInterface( | ||
| typelib_ob, progressInstance=None, bForDemand: bool | Literal[0, 1] = ..., bBuildHidden: bool | Literal[0, 1] = 1 | ||
| ) -> ModuleType | None: ... | ||
| def EnsureModuleForTypelibInterface( | ||
| typelib_ob, progressInstance=None, bForDemand: bool | Literal[0, 1] = ..., bBuildHidden: bool | Literal[0, 1] = 1 | ||
| ) -> ModuleType | None: ... | ||
| def ForgetAboutTypelibInterface(typelib_ob) -> None: ... | ||
| def EnsureModule( | ||
| typelibCLSID, | ||
| lcid, | ||
| major, | ||
| minor, | ||
| progressInstance=None, | ||
| bValidateFile: bool | Literal[0, 1] = ..., | ||
| bForDemand: bool | Literal[0, 1] = ..., | ||
| bBuildHidden: bool | Literal[0, 1] = 1, | ||
| ) -> ModuleType | None: ... | ||
| def EnsureDispatch( | ||
| prog_id: str | dynamic.PyIDispatchType | dynamic._GoodDispatchTypes | dynamic.PyIUnknownType, bForDemand: int = ... | ||
| prog_id: str | dynamic.PyIDispatchType | IIDType | dynamic.PyIUnknownType, bForDemand: bool | Literal[0, 1] = 1 | ||
| ) -> dynamic.CDispatch: ... | ||
| def AddModuleToCache(typelibclsid, lcid, major, minor, verbose: Unused = 1, bFlushNow: bool | Literal[0, 1] = ...) -> None: ... | ||
| def GetGeneratedInfos() -> list[tuple[Incomplete, Incomplete, Incomplete, Incomplete]]: ... | ||
| def Rebuild(verbose: bool | Literal[0, 1] = 1) -> None: ... | ||
| def usage() -> NoReturn: ... |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @brianschubert I didn’t find any occurrences of this name in the source code (via grep), so I thought this case might also be interesting for your stubtest patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is covered by an allowlist entry, which is why it hasn't been flagged yet:
typeshed/stubs/pywin32/@tests/stubtest_allowlist_win32.txt
Lines 14 to 15 in 50ec910
Maybe you can refine that while we're here?