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

Simplify simple functions by using assignments #2214

Merged
merged 5 commits into from
May 28, 2024

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Mar 17, 2024

No description provided.

@Avasam Avasam changed the title Remove old helper function MakeMethod left behind Simplify simple functions by using assignments Mar 17, 2024
Comment on lines -67 to -68
def MakeMethod(func, inst, cls):
return types.MethodType(func, inst)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really should've been removed with 9a11ef0

return isinstance(obj, (types.FunctionType, types.MethodType))
# ignore hasattr(obj, "__call__") as this means all COM objects!
# ignore hasattr(obj, "__call__") as this means all COM objects!
_CallableTypes = (types.FunctionType, types.MethodType)
Copy link
Collaborator Author

@Avasam Avasam Mar 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gonna be beneficial for type-checkers too! (Either that or making this function a TypeGuard)

@Avasam Avasam merged commit f1764bf into mhammond:main May 28, 2024
27 checks passed
@Avasam Avasam deleted the remove-MakeMethod branch May 28, 2024 14:19
clin1234 pushed a commit to clin1234/pywin32 that referenced this pull request May 28, 2024
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.

2 participants