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
2d497d65
Commit
2d497d65
authored
Oct 25, 2019
by
Éloi Rivard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syntax highlight for every piece of code
parent
3b1ea272
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
docs/overview.rst
docs/overview.rst
+16
-14
No files found.
docs/overview.rst
View file @
2d497d65
...
...
@@ -258,12 +258,12 @@ For example,
.. doctest::
class Mine:
def __cmp__(self, other):
if other.__class__ is Mine:
return cmp(self.data, other.data)
else:
return cmp(self.data, other)
>>>
class Mine:
...
def __cmp__(self, other):
...
if other.__class__ is Mine:
...
return cmp(self.data, other.data)
...
else:
...
return cmp(self.data, other)
It's quite possible there that the :keyword:`else` clause allows a result to be
computed based on memory address. The bug won't show up until a BTree-based
...
...
@@ -395,11 +395,11 @@ may want to override the default sizes. You can do this by
subclassing any of the BTree (or TreeSet) classes and specifying new
values for ``max_leaf_size`` or ``max_internal_size`` in your subclass::
import BTrees.OOBTree
>>>
import BTrees.OOBTree
class MyBTree(BTrees.OOBTree.BTree):
max_leaf_size = 500
max_internal_size = 1000
>>>
class MyBTree(BTrees.OOBTree.BTree):
...
max_leaf_size = 500
...
max_internal_size = 1000
``max_leaf_size`` is used for leaf nodes in a BTree, either Buckets or
Sets. ``max_internal_size`` is used for internal nodes, either BTrees
...
...
@@ -431,15 +431,17 @@ Repairing a damaged BTree is usually best done by making a copy of it. For
example, if *self.data* is bound to a corrupted IOBTree,
.. doctest::
:options: +SKIP
self.data = IOBTree(self.data)
>>>
self.data = IOBTree(self.data)
usually suffices. If object identity needs to be preserved,
.. doctest::
:options: +SKIP
acopy = IOBTree(self.data)
self.data.clear()
self.data.update(acopy)
>>>
acopy = IOBTree(self.data)
>>>
self.data.clear()
>>>
self.data.update(acopy)
does the same, but leaves *self.data* bound to the same object.
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