Kaydet (Commit) fd240541 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Remove duplicate recipe.

üst 4585ca94
...@@ -702,11 +702,6 @@ which incur interpreter overhead. ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment