Commit 8da9003b authored by Tres Seaver's avatar Tres Seaver

No else: after return.

parent 9edd1313
...@@ -1235,25 +1235,21 @@ def intersection(set_type, o1, o2): ...@@ -1235,25 +1235,21 @@ def intersection(set_type, o1, o2):
def weightedUnion(set_type, o1, o2, w1=1, w2=1): def weightedUnion(set_type, o1, o2, w1=1, w2=1):
if o1 is None: if o1 is None:
if o2 is None: if o2 is None:
return 0, o2 return 0, None
else: return w2, o2
return w2, o2 if o2 is None:
elif o2 is None:
return w1, o1 return w1, o1
else: return 1, _set_operation(o1, o2, 1, 1, w1, w2, 1, 1, 1)
return 1, _set_operation(o1, o2, 1, 1, w1, w2, 1, 1, 1)
def weightedIntersection(set_type, o1, o2, w1=1, w2=1): def weightedIntersection(set_type, o1, o2, w1=1, w2=1):
if o1 is None: if o1 is None:
if o2 is None: if o2 is None:
return 0, o2 return 0, o2
else: return w2, o2
return w2, o2 if o2 is None:
elif o2 is None:
return w1, o1 return w1, o1
else: result = _set_operation(o1, o2, 1, 1, w1, w2, 0, 1, 0)
result = _set_operation(o1, o2, 1, 1, w1, w2, 0, 1, 0) return (w1 + w2 if isinstance(result, (Set, TreeSet)) else 1, result)
return (w1 + w2 if isinstance(result, (Set, TreeSet)) else 1, result)
def multiunion(set_type, seqs): def multiunion(set_type, seqs):
# XXX simple/slow implementation. Goal is just to get tests to pass. # XXX simple/slow implementation. Goal is just to get tests to pass.
......
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