# HG changeset patch # User Sverre Rabbelier # Date 1229028837 0 # Node ID 2e635755713a3bf60938acd2bc39138161582283 # Parent 5f9b1676816d512be5fa75b06447a2ebdba4f7dd Added a trivial unzip method, counterpart to zip Patch by: Sverre Rabbelier diff -r 5f9b1676816d -r 2e635755713a app/soc/logic/dicts.py --- a/app/soc/logic/dicts.py Thu Dec 11 04:23:42 2008 +0000 +++ b/app/soc/logic/dicts.py Thu Dec 11 20:53:57 2008 +0000 @@ -89,6 +89,18 @@ return result + +def unzip(target, order): + """Constructs a list from target in the order specified by order + + Args: + target: the dictionary to pull the values from + order: the order of the keys + """ + + return (target[key] for key in order) + + def rename(target, keys): """Returns a dict containing only the key/value pairs from keys.