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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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)

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.

None yet

1 participant