Project

General

Profile

« Previous | Next » 

Revision 1145

util.py: Added list_flip()

View differences:

lib/util.py
81 81
        if list0[i] is not list1[i]: return False
82 82
    return True
83 83

  
84
def list_flip(list_): return dict((v, i) for i, v in enumerate(list_))
85

  
84 86
#### Dicts
85 87

  
86 88
def rename_key(dict_, orig, new): dict_[new] = dict_.pop(orig)

Also available in: Unified diff