Fall back from gen_py to dynamic COM client class & fix property ID caching#1931
Draft
kxrob wants to merge 3 commits intomhammond:mainfrom
Draft
Fall back from gen_py to dynamic COM client class & fix property ID caching#1931kxrob wants to merge 3 commits intomhammond:mainfrom
kxrob wants to merge 3 commits intomhammond:mainfrom
Conversation
COM object properties which are not found by __LazyMap__() / PyITypeComp.Bind(), but only by __AttrToID__() / GetIDsOfNames() were not ID-cached and caused time consuming search upon every read.
.. when type info may be incomplete.
Example "Microsoft WMI Scripting Library": This failed
before when pre-compiled in win32com.gen_py:
WMI = win32com.client.GetObject('winmgmts:')
processes = WMI.InstancesOf('Win32_Process')
processes.ItemIndex(0).Name
Closed
This was referenced Sep 14, 2022
Owner
|
This is a fairly simple change which is great! It's still a WIP so it's not clear what else you intend doing, but given you mention WMI it would be fantastic if some tests which demonstrate the improvements could be added. |
Open
Avasam
reviewed
May 4, 2026
| retEntry = self._olerepr_.propMapGet.get(attr) | ||
| if retEntry is None: | ||
| retEntry = build.MapEntry(self.__AttrToID__(attr), (attr,)) | ||
| self._olerepr_.propMap[attr] = retEntry |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Necessary e.g. for the WMI scripting library