Revision 2669
Added by Aaron Marcuse-Kubitza about 12 years ago
lib/lists.py | ||
---|---|---|
2 | 2 |
|
3 | 3 |
def is_seq(value): return isinstance(value, list) or isinstance(value, tuple) |
4 | 4 |
|
5 |
def clear(list_): |
|
6 |
while True: |
|
7 |
try: list_.pop() |
|
8 |
except IndexError: break |
|
9 |
|
|
5 | 10 |
def uniqify(list_): |
6 | 11 |
'''Removes duplicates from a list. Preserves order.''' |
7 | 12 |
existing = set() |
Also available in: Unified diff
lists.py: Added clear()