Remove duplicate recipe.

This commit is contained in:
Raymond Hettinger 2009-04-18 23:58:45 +00:00
parent 4585ca9428
commit fd2405415b
1 changed files with 0 additions and 5 deletions

View File

@ -702,11 +702,6 @@ which incur interpreter overhead.
pending -= 1 pending -= 1
nexts = cycle(islice(nexts, pending)) nexts = cycle(islice(nexts, pending))
def powerset(iterable):
"powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
s = list(iterable)
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
def compress(data, selectors): def compress(data, selectors):
"compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F" "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F"
return (d for d, s in izip(data, selectors) if s) return (d for d, s in izip(data, selectors) if s)