Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/file/6c6ae5013ab6/allpy/util.py
Дата изменения: Unknown
Дата индексирования: Sun Feb 3 21:35:47 2013
Кодировка:
allpy: 6c6ae5013ab6 allpy/util.py

allpy

view allpy/util.py @ 593:6c6ae5013ab6

add pair_cores program package * pair_cores * score * mkhtml
author boris (kodomo) <bnagaev@gmail.com>
date Sat, 26 Mar 2011 10:48:11 +0300
parents e5c8deea6f83
children 4bc2075d338a
line source
1 """Miscellanous utilities.
2 """
4 def unzip(seq):
5 """The oppozite of zip() builtin."""
6 a, b = [], []
7 for x, y in seq:
8 a.append(x)
9 b.append(y)
10 return a, b
12 def remove_each(string, substrings):
13 """Remove each of substrings from string."""
14 for sub in substrings:
15 string = string.replace(sub, "")
16 return string
18 class UserDict(dict):
19 """Clone of dict that user may add attributes to."""
20 pass
22 class UserList(list):
23 """Clone of list that user may add attributes to."""
24 pass
26 # vim: set et ts=4 sts=4 sw=4: