Skip to content

Simplify simple functions by using assignments#2214

Merged
Avasam merged 5 commits intomhammond:mainfrom
Avasam:remove-MakeMethod
May 28, 2024
Merged

Simplify simple functions by using assignments#2214
Avasam merged 5 commits intomhammond:mainfrom
Avasam:remove-MakeMethod

Conversation

@Avasam
Copy link
Copy Markdown
Collaborator

@Avasam Avasam commented Mar 17, 2024

No description provided.

@Avasam Avasam force-pushed the remove-MakeMethod branch from 1fb650e to 2308b35 Compare March 17, 2024 04:44
@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
Copy Markdown
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
Copy Markdown
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
@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