Posted By

dsonbill on 06/25/14


Tagged

python redis


Versions (?)

Python formatKey for Redis


 / Published in: Python
 

Tiny python closure for combining redis keys with "format". Uses a closure so it does not remake the base key each use.

  1. def formatKey():
  2. key = '{}:{}'
  3. def fmtK(k1, k2):
  4. return key.format(k1, k2)
  5. return fmtK

Report this snippet  

You need to login to post a comment.