Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
BTrees
Commits
8da9003b
Commit
8da9003b
authored
Dec 04, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No else: after return.
parent
9edd1313
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
BTrees/_base.py
BTrees/_base.py
+8
-12
No files found.
BTrees/_base.py
View file @
8da9003b
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment