Message51879
I'm rejecting the patch, because YAGNI. I agree that the quality of the patch is good; thanks for submitting it. I encourage you to post it to the Python Cookbook (if it's not there already); perhaps people may come back with an actual use case some day.
As for composing functions that are determined dynamically: this can be done already. Assume f and g are variables, you can do lambda arg:f(g(arg)). What you can't do is if you have a variably-sized list of functions to compose, but again, I think YAGNI (if that ever happens, writing a loop is easy enough).
Wrt newbies: I agree they have difficulties with lambda, but I think that is because they always have difficulties with first-class and higher-order functions. So they likely have the same problems with itemgetter and attrgetter (which are higher-order), and would have problems with compose. Even though I believe I can deal with callable objects just fine, I had problems understanding the example, because the order of the itemgetters is reversed to the "logical" order - although it is the standard order for composition in mathematics. |
|
Date |
User |
Action |
Args |
2007-08-23 15:56:34 | admin | link | issue1660179 messages |
2007-08-23 15:56:34 | admin | create | |
|