Re:More intuitive partial function application in Python
by cgrimm1994 on Monday February 21, 2022 @09:13AM
(#30416069)
I'm glad you like it! I agree it's not optimal to have to wrap existing functions. One option would be to decorate the functions as they're defined, although you cant do this for external functions.
In my perfect world, python functions would default to behaving as they do when decorated with better_partial.partial, but it seems like a long-shot to try to get something like this added to the language itself.
My only grief is that decorator, which forces you to wrap existing functions anyway (same way I had to define lambdas in my example anyway).
Do you have any insight on that?