News for hackers. Stuff that matters.
Re:More intuitive partial function application in Python by tpoacher on Monday February 21, 2022 @05:45AM (#30414222)
This is great. I will use it with my python chaining approach: https://github.com/tpapastylianou/chain-ops-python

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?

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.