-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Comments PTS 13] Rethinking Python decorators #13
Comments
Thank you for this post! It was precisely what I needed. I was able to refactor an existing library containing a combination of nested lambdas, decorators, and inner functions using plain pickle, and then distribute using dask. |
Hi @caseyclements ! Thanks very much for your comment. I am really happy you could use that strategy to refact on your side. Not much people talk about these intricate topics and there is definitively a leap from using python to write scripts and using python to write whole and structured programs. Have you encountered any difficulties or additions beyond what I refer in my post? Glad to discuss further 👍 Cheers, |
Thanks for the interesting explanation. Using your |
Hi @bernstei, thanks so much for your feedback. It really means a lot to me you enjoyed the post and that it was useful for you. Replacing the pfunc = functools.partial(myfunc, arg1=10)
pfunc.__doc__ = """Does what myfunc does but with arg1 = 10""" # you can go multiline here.
help(pfunc) # shows you the new docstring. Cheers, |
Thanks indeed for your work. I needed a multiprocessing safe "decorator". The partial strategy works great ! |
Many thanks @mutricyl for your feedback. All the best! |
Original post: https://pythonicthoughtssnippets.github.io/2020/08/09/PTS13-rethinking-python-decorators.html
Post on DEV: https://dev.to/joaomcteixeira/rethinking-python-decorators-2g53
The text was updated successfully, but these errors were encountered: