This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients
Date 2007-02-16.12:53:57
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 15:56:34adminlinkissue1660179 messages
2007-08-23 15:56:34admincreate