Skip to content
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

Improve patching classes in _compointer_meta. #624

Merged

Conversation

junkmd
Copy link
Collaborator

@junkmd junkmd commented Sep 27, 2024

While experimenting with #618, I noticed that _cominterface_meta.__new__ has quite a large number of lines.
Most of these lines come from patching multiple classes with patcher.Patch, so I refactored them into a separate method to reduce the number of lines in __new__ itself.

I considered that it could cause confusion if the separated method were an instance method with self as the first argument, as the self of the class's instance methods which are defined inside the method, could get mixed up.
Therefore, I defined the refactored method as a private staticmethod.

@junkmd junkmd added this to the 1.4.8 milestone Sep 27, 2024
junkmd added a commit to junkmd/pywinauto that referenced this pull request Sep 27, 2024
@junkmd junkmd merged commit 07a3b83 into enthought:main Sep 27, 2024
41 checks passed
@junkmd junkmd deleted the improve_patching_classes_in_compointer_meta branch September 27, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant