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

add __name__ to RunWithLock #336

Closed

Conversation

mski-iksm
Copy link
Contributor

No description provided.

Comment on lines +19 to +21
def __name__(self):
return self._func.__name__

Copy link
Member

@Hi-king Hi-king Nov 21, 2023

Choose a reason for hiding this comment

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

How about using dynamic wrapper pattern ?
https://python-patterns.guide/gang-of-four/decorator-pattern/#implementing-dynamic-wrapper

Suggested change
def __name__(self):
return self._func.__name__
def __getattr__(self, name):
return getattr(self._func, name)

@mski-iksm mski-iksm closed this Nov 21, 2023
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