Posted By

collin on 11/15/06


Tagged

python function compose reduce functional partial composition


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

anayhk
gartenstuhl


A multi-function compose


 / Published in: Python
 

URL: http://oakwinter.com/code/functional/documentation/cookbook.html

Since the version of compose() that ships with functional only allows you to compose two functions, I present this version that composes n functions.

  1. from functional import partial, compose
  2.  
  3. multi_compose = partial(reduce, compose)

Report this snippet  

You need to login to post a comment.