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
6d20f049
Commit
6d20f049
authored
Jan 12, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'expose_tree_iterator'
parents
09fea274
d00b5907
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
113 additions
and
34 deletions
+113
-34
BTrees/BTreeItemsTemplate.c
BTrees/BTreeItemsTemplate.c
+33
-33
BTrees/IFBTree.py
BTrees/IFBTree.py
+7
-0
BTrees/IIBTree.py
BTrees/IIBTree.py
+7
-0
BTrees/IOBTree.py
BTrees/IOBTree.py
+6
-0
BTrees/LFBTree.py
BTrees/LFBTree.py
+7
-0
BTrees/LLBTree.py
BTrees/LLBTree.py
+7
-0
BTrees/LOBTree.py
BTrees/LOBTree.py
+7
-0
BTrees/OIBTree.py
BTrees/OIBTree.py
+7
-0
BTrees/OLBTree.py
BTrees/OLBTree.py
+7
-0
BTrees/OOBTree.py
BTrees/OOBTree.py
+7
-0
BTrees/_base.py
BTrees/_base.py
+12
-0
BTrees/tests/common.py
BTrees/tests/common.py
+6
-1
No files found.
BTrees/BTreeItemsTemplate.c
View file @
6d20f049
...
@@ -753,7 +753,7 @@ BTreeIter_getiter(PyObject *it)
...
@@ -753,7 +753,7 @@ BTreeIter_getiter(PyObject *it)
static
PyTypeObject
BTreeIter_Type
=
{
static
PyTypeObject
BTreeIter_Type
=
{
PyVarObject_HEAD_INIT
(
NULL
,
0
)
PyVarObject_HEAD_INIT
(
NULL
,
0
)
MOD
_NAME_PREFIX
"-iterator"
,
/* tp_name */
MOD
ULE_NAME
MOD_NAME_PREFIX
"TreeIterator"
,
/* tp_name */
sizeof
(
BTreeIter
),
/* tp_basicsize */
sizeof
(
BTreeIter
),
/* tp_basicsize */
0
,
/* tp_itemsize */
0
,
/* tp_itemsize */
/* methods */
/* methods */
...
...
BTrees/IFBTree.py
View file @
6d20f049
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_float
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_float
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
multiunion
as
_multiunion
from
._base
import
multiunion
as
_multiunion
...
@@ -76,6 +77,10 @@ class IFTreeSetPy(TreeSet):
...
@@ -76,6 +77,10 @@ class IFTreeSetPy(TreeSet):
MERGE_DEFAULT
=
MERGE_DEFAULT_float
MERGE_DEFAULT
=
MERGE_DEFAULT_float
class
IFTreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
IFBucketPy
.
_mapping_type
=
IFBucketPy
.
_bucket_type
=
IFBucketPy
IFBucketPy
.
_mapping_type
=
IFBucketPy
.
_bucket_type
=
IFBucketPy
...
@@ -105,6 +110,7 @@ except ImportError: #pragma NO COVER w/ C extensions
...
@@ -105,6 +110,7 @@ except ImportError: #pragma NO COVER w/ C extensions
IFSet
=
IFSetPy
IFSet
=
IFSetPy
IFBTree
=
IFBTreePy
IFBTree
=
IFBTreePy
IFTreeSet
=
IFTreeSetPy
IFTreeSet
=
IFTreeSetPy
IFTreeIterator
=
IFTreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -115,6 +121,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -115,6 +121,7 @@ else: #pragma NO COVER w/o C extensions
from
._IFBTree
import
IFSet
from
._IFBTree
import
IFSet
from
._IFBTree
import
IFBTree
from
._IFBTree
import
IFBTree
from
._IFBTree
import
IFTreeSet
from
._IFBTree
import
IFTreeSet
from
._IFBTree
import
IFTreeIterator
from
._IFBTree
import
difference
from
._IFBTree
import
difference
from
._IFBTree
import
union
from
._IFBTree
import
union
from
._IFBTree
import
intersection
from
._IFBTree
import
intersection
...
...
BTrees/IIBTree.py
View file @
6d20f049
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_int
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_int
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
multiunion
as
_multiunion
from
._base
import
multiunion
as
_multiunion
...
@@ -77,6 +78,10 @@ class IITreeSetPy(TreeSet):
...
@@ -77,6 +78,10 @@ class IITreeSetPy(TreeSet):
MERGE_DEFAULT
=
MERGE_DEFAULT_int
MERGE_DEFAULT
=
MERGE_DEFAULT_int
class
IITreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
IIBucketPy
.
_mapping_type
=
IIBucketPy
.
_bucket_type
=
IIBucketPy
IIBucketPy
.
_mapping_type
=
IIBucketPy
.
_bucket_type
=
IIBucketPy
...
@@ -106,6 +111,7 @@ except ImportError: #pragma NO COVER w/ C extensions
...
@@ -106,6 +111,7 @@ except ImportError: #pragma NO COVER w/ C extensions
IISet
=
IISetPy
IISet
=
IISetPy
IIBTree
=
IIBTreePy
IIBTree
=
IIBTreePy
IITreeSet
=
IITreeSetPy
IITreeSet
=
IITreeSetPy
IITreeIterator
=
IITreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -116,6 +122,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -116,6 +122,7 @@ else: #pragma NO COVER w/o C extensions
from
._IIBTree
import
IISet
from
._IIBTree
import
IISet
from
._IIBTree
import
IIBTree
from
._IIBTree
import
IIBTree
from
._IIBTree
import
IITreeSet
from
._IIBTree
import
IITreeSet
from
._IIBTree
import
IITreeIterator
from
._IIBTree
import
difference
from
._IIBTree
import
difference
from
._IIBTree
import
union
from
._IIBTree
import
union
from
._IIBTree
import
intersection
from
._IIBTree
import
intersection
...
...
BTrees/IOBTree.py
View file @
6d20f049
...
@@ -25,6 +25,7 @@ from ._base import MERGE_WEIGHT_default
...
@@ -25,6 +25,7 @@ from ._base import MERGE_WEIGHT_default
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
multiunion
as
_multiunion
from
._base
import
multiunion
as
_multiunion
...
@@ -61,6 +62,9 @@ class IOTreeSetPy(TreeSet):
...
@@ -61,6 +62,9 @@ class IOTreeSetPy(TreeSet):
MAX_SIZE
=
_TREE_SIZE
MAX_SIZE
=
_TREE_SIZE
_to_key
=
_to_key
_to_key
=
_to_key
class
IOTreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
...
@@ -89,6 +93,7 @@ except ImportError: #pragma NO COVER w/ C extensions
...
@@ -89,6 +93,7 @@ except ImportError: #pragma NO COVER w/ C extensions
IOSet
=
IOSetPy
IOSet
=
IOSetPy
IOBTree
=
IOBTreePy
IOBTree
=
IOBTreePy
IOTreeSet
=
IOTreeSetPy
IOTreeSet
=
IOTreeSetPy
IOTreeIterator
=
IOTreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -97,6 +102,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -97,6 +102,7 @@ else: #pragma NO COVER w/o C extensions
from
._IOBTree
import
IOSet
from
._IOBTree
import
IOSet
from
._IOBTree
import
IOBTree
from
._IOBTree
import
IOBTree
from
._IOBTree
import
IOTreeSet
from
._IOBTree
import
IOTreeSet
from
._IOBTree
import
IOTreeIterator
from
._IOBTree
import
difference
from
._IOBTree
import
difference
from
._IOBTree
import
union
from
._IOBTree
import
union
from
._IOBTree
import
intersection
from
._IOBTree
import
intersection
...
...
BTrees/LFBTree.py
View file @
6d20f049
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_float
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_float
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
multiunion
as
_multiunion
from
._base
import
multiunion
as
_multiunion
...
@@ -77,6 +78,10 @@ class LFTreeSetPy(TreeSet):
...
@@ -77,6 +78,10 @@ class LFTreeSetPy(TreeSet):
MERGE_DEFAULT
=
MERGE_DEFAULT_float
MERGE_DEFAULT
=
MERGE_DEFAULT_float
class
LFTreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
LFBucketPy
.
_mapping_type
=
LFBucketPy
.
_bucket_type
=
LFBucketPy
LFBucketPy
.
_mapping_type
=
LFBucketPy
.
_bucket_type
=
LFBucketPy
...
@@ -106,6 +111,7 @@ except ImportError: #pragma NO COVER w/ C extensions
...
@@ -106,6 +111,7 @@ except ImportError: #pragma NO COVER w/ C extensions
LFSet
=
LFSetPy
LFSet
=
LFSetPy
LFBTree
=
LFBTreePy
LFBTree
=
LFBTreePy
LFTreeSet
=
LFTreeSetPy
LFTreeSet
=
LFTreeSetPy
LFTreeIterator
=
LFTreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -116,6 +122,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -116,6 +122,7 @@ else: #pragma NO COVER w/o C extensions
from
._LFBTree
import
LFSet
from
._LFBTree
import
LFSet
from
._LFBTree
import
LFBTree
from
._LFBTree
import
LFBTree
from
._LFBTree
import
LFTreeSet
from
._LFBTree
import
LFTreeSet
from
._LFBTree
import
LFTreeIterator
from
._LFBTree
import
difference
from
._LFBTree
import
difference
from
._LFBTree
import
union
from
._LFBTree
import
union
from
._LFBTree
import
intersection
from
._LFBTree
import
intersection
...
...
BTrees/LLBTree.py
View file @
6d20f049
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_int
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_int
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
multiunion
as
_multiunion
from
._base
import
multiunion
as
_multiunion
...
@@ -77,6 +78,10 @@ class LLTreeSetPy(TreeSet):
...
@@ -77,6 +78,10 @@ class LLTreeSetPy(TreeSet):
MERGE_DEFAULT
=
MERGE_DEFAULT_int
MERGE_DEFAULT
=
MERGE_DEFAULT_int
class
LLTreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
LLBucketPy
.
_mapping_type
=
LLBucketPy
.
_bucket_type
=
LLBucketPy
LLBucketPy
.
_mapping_type
=
LLBucketPy
.
_bucket_type
=
LLBucketPy
...
@@ -106,6 +111,7 @@ except ImportError: #pragma NO COVER w/ C extensions
...
@@ -106,6 +111,7 @@ except ImportError: #pragma NO COVER w/ C extensions
LLSet
=
LLSetPy
LLSet
=
LLSetPy
LLBTree
=
LLBTreePy
LLBTree
=
LLBTreePy
LLTreeSet
=
LLTreeSetPy
LLTreeSet
=
LLTreeSetPy
LLTreeIterator
=
LLTreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -116,6 +122,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -116,6 +122,7 @@ else: #pragma NO COVER w/o C extensions
from
._LLBTree
import
LLSet
from
._LLBTree
import
LLSet
from
._LLBTree
import
LLBTree
from
._LLBTree
import
LLBTree
from
._LLBTree
import
LLTreeSet
from
._LLBTree
import
LLTreeSet
from
._LLBTree
import
LLTreeIterator
from
._LLBTree
import
difference
from
._LLBTree
import
difference
from
._LLBTree
import
union
from
._LLBTree
import
union
from
._LLBTree
import
intersection
from
._LLBTree
import
intersection
...
...
BTrees/LOBTree.py
View file @
6d20f049
...
@@ -25,6 +25,7 @@ from ._base import MERGE_WEIGHT_default
...
@@ -25,6 +25,7 @@ from ._base import MERGE_WEIGHT_default
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
multiunion
as
_multiunion
from
._base
import
multiunion
as
_multiunion
...
@@ -62,6 +63,10 @@ class LOTreeSetPy(TreeSet):
...
@@ -62,6 +63,10 @@ class LOTreeSetPy(TreeSet):
_to_key
=
_to_key
_to_key
=
_to_key
class
LOTreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
LOBucketPy
.
_mapping_type
=
LOBucketPy
.
_bucket_type
=
LOBucketPy
LOBucketPy
.
_mapping_type
=
LOBucketPy
.
_bucket_type
=
LOBucketPy
...
@@ -89,6 +94,7 @@ except ImportError: #pragma NO COVER w/ C extensions
...
@@ -89,6 +94,7 @@ except ImportError: #pragma NO COVER w/ C extensions
LOSet
=
LOSetPy
LOSet
=
LOSetPy
LOBTree
=
LOBTreePy
LOBTree
=
LOBTreePy
LOTreeSet
=
LOTreeSetPy
LOTreeSet
=
LOTreeSetPy
LOTreeIterator
=
LOTreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -97,6 +103,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -97,6 +103,7 @@ else: #pragma NO COVER w/o C extensions
from
._LOBTree
import
LOSet
from
._LOBTree
import
LOSet
from
._LOBTree
import
LOBTree
from
._LOBTree
import
LOBTree
from
._LOBTree
import
LOTreeSet
from
._LOBTree
import
LOTreeSet
from
._LOBTree
import
LOTreeIterator
from
._LOBTree
import
difference
from
._LOBTree
import
difference
from
._LOBTree
import
union
from
._LOBTree
import
union
from
._LOBTree
import
intersection
from
._LOBTree
import
intersection
...
...
BTrees/OIBTree.py
View file @
6d20f049
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_float
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_float
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
set_operation
as
_set_operation
from
._base
import
set_operation
as
_set_operation
...
@@ -75,6 +76,10 @@ class OITreeSetPy(TreeSet):
...
@@ -75,6 +76,10 @@ class OITreeSetPy(TreeSet):
MERGE_DEFAULT
=
MERGE_DEFAULT_float
MERGE_DEFAULT
=
MERGE_DEFAULT_float
class
OITreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
OIBucketPy
.
_mapping_type
=
OIBucketPy
.
_bucket_type
=
OIBucketPy
OIBucketPy
.
_mapping_type
=
OIBucketPy
.
_bucket_type
=
OIBucketPy
...
@@ -103,6 +108,7 @@ except ImportError: #pragma NO COVER w/ C extensions
...
@@ -103,6 +108,7 @@ except ImportError: #pragma NO COVER w/ C extensions
OISet
=
OISetPy
OISet
=
OISetPy
OIBTree
=
OIBTreePy
OIBTree
=
OIBTreePy
OITreeSet
=
OITreeSetPy
OITreeSet
=
OITreeSetPy
OITreeIterator
=
OITreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -112,6 +118,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -112,6 +118,7 @@ else: #pragma NO COVER w/o C extensions
from
._OIBTree
import
OISet
from
._OIBTree
import
OISet
from
._OIBTree
import
OIBTree
from
._OIBTree
import
OIBTree
from
._OIBTree
import
OITreeSet
from
._OIBTree
import
OITreeSet
from
._OIBTree
import
OITreeIterator
from
._OIBTree
import
difference
from
._OIBTree
import
difference
from
._OIBTree
import
union
from
._OIBTree
import
union
from
._OIBTree
import
intersection
from
._OIBTree
import
intersection
...
...
BTrees/OLBTree.py
View file @
6d20f049
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_int
...
@@ -28,6 +28,7 @@ from ._base import MERGE_DEFAULT_int
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
set_operation
as
_set_operation
from
._base
import
set_operation
as
_set_operation
...
@@ -76,6 +77,10 @@ class OLTreeSetPy(TreeSet):
...
@@ -76,6 +77,10 @@ class OLTreeSetPy(TreeSet):
MERGE_DEFAULT
=
MERGE_DEFAULT_int
MERGE_DEFAULT
=
MERGE_DEFAULT_int
class
OLTreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
OLBucketPy
.
_mapping_type
=
OLBucketPy
.
_bucket_type
=
OLBucketPy
OLBucketPy
.
_mapping_type
=
OLBucketPy
.
_bucket_type
=
OLBucketPy
...
@@ -104,6 +109,7 @@ except ImportError: #pragma NO COVER w/ C extensions
...
@@ -104,6 +109,7 @@ except ImportError: #pragma NO COVER w/ C extensions
OLSet
=
OLSetPy
OLSet
=
OLSetPy
OLBTree
=
OLBTreePy
OLBTree
=
OLBTreePy
OLTreeSet
=
OLTreeSetPy
OLTreeSet
=
OLTreeSetPy
OLTreeIterator
=
OLTreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -113,6 +119,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -113,6 +119,7 @@ else: #pragma NO COVER w/o C extensions
from
._OLBTree
import
OLSet
from
._OLBTree
import
OLSet
from
._OLBTree
import
OLBTree
from
._OLBTree
import
OLBTree
from
._OLBTree
import
OLTreeSet
from
._OLBTree
import
OLTreeSet
from
._OLBTree
import
OLTreeIterator
from
._OLBTree
import
difference
from
._OLBTree
import
difference
from
._OLBTree
import
union
from
._OLBTree
import
union
from
._OLBTree
import
intersection
from
._OLBTree
import
intersection
...
...
BTrees/OOBTree.py
View file @
6d20f049
...
@@ -24,6 +24,7 @@ from ._base import Bucket
...
@@ -24,6 +24,7 @@ from ._base import Bucket
from
._base
import
Set
from
._base
import
Set
from
._base
import
Tree
as
BTree
from
._base
import
Tree
as
BTree
from
._base
import
TreeSet
from
._base
import
TreeSet
from
._base
import
_TreeIterator
from
._base
import
difference
as
_difference
from
._base
import
difference
as
_difference
from
._base
import
intersection
as
_intersection
from
._base
import
intersection
as
_intersection
from
._base
import
set_operation
as
_set_operation
from
._base
import
set_operation
as
_set_operation
...
@@ -58,6 +59,10 @@ class OOTreeSetPy(TreeSet):
...
@@ -58,6 +59,10 @@ class OOTreeSetPy(TreeSet):
_to_key
=
_to_key
_to_key
=
_to_key
class
OOTreeIteratorPy
(
_TreeIterator
):
pass
# Can't declare forward refs, so fix up afterwards:
# Can't declare forward refs, so fix up afterwards:
OOBucketPy
.
_mapping_type
=
OOBucketPy
.
_bucket_type
=
OOBucketPy
OOBucketPy
.
_mapping_type
=
OOBucketPy
.
_bucket_type
=
OOBucketPy
...
@@ -84,6 +89,7 @@ except ImportError as e: #pragma NO COVER w/ C extensions
...
@@ -84,6 +89,7 @@ except ImportError as e: #pragma NO COVER w/ C extensions
OOSet
=
OOSetPy
OOSet
=
OOSetPy
OOBTree
=
OOBTreePy
OOBTree
=
OOBTreePy
OOTreeSet
=
OOTreeSetPy
OOTreeSet
=
OOTreeSetPy
OOTreeIterator
=
OOTreeIteratorPy
difference
=
differencePy
difference
=
differencePy
union
=
unionPy
union
=
unionPy
intersection
=
intersectionPy
intersection
=
intersectionPy
...
@@ -91,6 +97,7 @@ else: #pragma NO COVER w/o C extensions
...
@@ -91,6 +97,7 @@ else: #pragma NO COVER w/o C extensions
from
._OOBTree
import
OOSet
from
._OOBTree
import
OOSet
from
._OOBTree
import
OOBTree
from
._OOBTree
import
OOBTree
from
._OOBTree
import
OOTreeSet
from
._OOBTree
import
OOTreeSet
from
._OOBTree
import
OOTreeIterator
from
._OOBTree
import
difference
from
._OOBTree
import
difference
from
._OOBTree
import
union
from
._OOBTree
import
union
from
._OOBTree
import
intersection
from
._OOBTree
import
intersection
...
...
BTrees/_base.py
View file @
6d20f049
...
@@ -1126,6 +1126,18 @@ class _TreeItems(object):
...
@@ -1126,6 +1126,18 @@ class _TreeItems(object):
done
=
1
done
=
1
class
_TreeIterator
(
object
):
""" Faux implementation for BBB only.
"""
def
__init__
(
self
,
items
):
#pragma NO COVOER
raise
TypeError
(
"TreeIterators are private implementation details "
"of the C-based BTrees.
\
n
\
n
"
"Please use 'iter(tree)', rather than instantiating "
"one directly."
)
class
Tree
(
_Tree
):
class
Tree
(
_Tree
):
__slots__
=
()
__slots__
=
()
...
...
BTrees/tests/common.py
View file @
6d20f049
...
@@ -1357,11 +1357,16 @@ class ModuleTest(object):
...
@@ -1357,11 +1357,16 @@ class ModuleTest(object):
def
_getModule
(
self
):
def
_getModule
(
self
):
pass
pass
def
testNames
(
self
):
def
testNames
(
self
):
for
name
in
(
'Bucket'
,
'BTree'
,
'Set'
,
'TreeSet'
):
names
=
[
'Bucket'
,
'BTree'
,
'Set'
,
'TreeSet'
]
for
name
in
names
:
klass
=
getattr
(
self
.
_getModule
(),
name
)
klass
=
getattr
(
self
.
_getModule
(),
name
)
self
.
assertEqual
(
klass
.
__module__
,
self
.
_getModule
().
__name__
)
self
.
assertEqual
(
klass
.
__module__
,
self
.
_getModule
().
__name__
)
self
.
assertTrue
(
klass
is
getattr
(
self
.
_getModule
(),
self
.
assertTrue
(
klass
is
getattr
(
self
.
_getModule
(),
self
.
prefix
+
name
))
self
.
prefix
+
name
))
# BBB for zope.app.security ZCML :(
pfx_iter
=
self
.
prefix
+
'TreeIterator'
klass
=
getattr
(
self
.
_getModule
(),
pfx_iter
)
self
.
assertEqual
(
klass
.
__module__
,
self
.
_getModule
().
__name__
)
def
testModuleProvides
(
self
):
def
testModuleProvides
(
self
):
from
zope.interface.verify
import
verifyObject
from
zope.interface.verify
import
verifyObject
...
...
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