Posted By

collin on 11/07/06


Tagged

python map strings compose functional partial join str


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

anayhk
fukami
taboularasa


An auto-stringifying join


 / Published in: Python
 

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

Tired of the Python's "".join(...) idiom requiring you to pre-stringify all the arguments to join()? Yeah, me too.

  1. from functional import partial, compose
  2.  
  3. join = compose("".join, partial(map, str))

Report this snippet  

You need to login to post a comment.