[Python-Dev] functools.compose to chain functions together (original) (raw)
Stefan Behnel stefan_ml at behnel.de
Mon Aug 17 11:14:05 CEST 2009
- Previous message: [Python-Dev] functools.compose to chain functions together
- Next message: [Python-Dev] functools.compose to chain functions together
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Antoine Pitrou wrote:
Raymond Hettinger <python rcn.com> writes:
IMO, its only virtue is that people coming from functional languages are used to having compose. Otherwise, it's a YAGNI. Then I wonder how partial() ended up in the stdlib. It seems hardly more useful than compose().
I would certainly consider it more useful, but that aside, it's also a lot simpler to understand and use than the proposed compose() function. I think the main difference is that compose() requires functional/math skills to be used and read correctly (and might still be surprising in some corner cases), whereas partial() only requires you to understand how to set a function argument. Totally different level of mental complexity, IMHO.
Stefan
- Previous message: [Python-Dev] functools.compose to chain functions together
- Next message: [Python-Dev] functools.compose to chain functions together
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]