Revision 1012
Added by Aaron Marcuse-Kubitza about 13 years ago
lib/util.py | ||
---|---|---|
69 | 69 |
try: return list_[idx] |
70 | 70 |
except IndexError: return default |
71 | 71 |
|
72 |
def list_eq_is(list0, list1): |
|
73 |
'''Compares two lists using is''' |
|
74 |
if len(list0) != len(list1): return False |
|
75 |
for i in xrange(len(list0)): |
|
76 |
if list0[i] is not list1[i]: return False |
|
77 |
return True |
|
78 |
|
|
72 | 79 |
#### Dicts |
73 | 80 |
|
74 | 81 |
def rename_key(dict_, orig, new): dict_[new] = dict_.pop(orig) |
Also available in: Unified diff
util.py: Added list_eq_is() to compare two lists using is