Commit 2d497d65 authored by Éloi Rivard's avatar Éloi Rivard

syntax highlight for every piece of code

parent 3b1ea272
...@@ -258,12 +258,12 @@ For example, ...@@ -258,12 +258,12 @@ For example,
.. doctest:: .. doctest::
class Mine: >>> class Mine:
def __cmp__(self, other): ... def __cmp__(self, other):
if other.__class__ is Mine: ... if other.__class__ is Mine:
return cmp(self.data, other.data) ... return cmp(self.data, other.data)
else: ... else:
return cmp(self.data, other) ... return cmp(self.data, other)
It's quite possible there that the :keyword:`else` clause allows a result to be 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 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 ...@@ -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 subclassing any of the BTree (or TreeSet) classes and specifying new
values for ``max_leaf_size`` or ``max_internal_size`` in your subclass:: values for ``max_leaf_size`` or ``max_internal_size`` in your subclass::
import BTrees.OOBTree >>> import BTrees.OOBTree
class MyBTree(BTrees.OOBTree.BTree): >>> class MyBTree(BTrees.OOBTree.BTree):
max_leaf_size = 500 ... max_leaf_size = 500
max_internal_size = 1000 ... max_internal_size = 1000
``max_leaf_size`` is used for leaf nodes in a BTree, either Buckets or ``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 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 ...@@ -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, example, if *self.data* is bound to a corrupted IOBTree,
.. doctest:: .. doctest::
:options: +SKIP
self.data = IOBTree(self.data) >>> self.data = IOBTree(self.data)
usually suffices. If object identity needs to be preserved, usually suffices. If object identity needs to be preserved,
.. doctest:: .. doctest::
:options: +SKIP
acopy = IOBTree(self.data) >>> acopy = IOBTree(self.data)
self.data.clear() >>> self.data.clear()
self.data.update(acopy) >>> self.data.update(acopy)
does the same, but leaves *self.data* bound to the same object. does the same, but leaves *self.data* bound to the same object.
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