An auto-stringifying join


/ Published in: Python
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. from functional import partial, compose
  2.  
  3. join = compose("".join, partial(map, str))

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.