app/soc/logic/dicts.py
changeset 1842 391b89d04bdd
parent 1749 a0ae6e6431a9
child 1899 c841800f3727
--- a/app/soc/logic/dicts.py	Fri Mar 13 23:10:49 2009 +0000
+++ b/app/soc/logic/dicts.py	Fri Mar 13 23:11:16 2009 +0000
@@ -207,3 +207,10 @@
 
   result = ((k, v[new_key]) for k, v in target.iteritems() if v[key])
   return dict(result)
+
+def identity(target):
+  """Returns a dictionary with the values equal to the keys.
+  """
+
+  result = [(i, i) for i in target]
+  return dict(result)