Commit 3b1ea272 authored by Éloi Rivard's avatar Éloi Rivard

Builds documentation with python3

parent 59faf125
...@@ -103,16 +103,12 @@ exclusive of the range's endpoints. ...@@ -103,16 +103,12 @@ exclusive of the range's endpoints.
1 1
>>> t.minKey(1.5) # smallest key >= 1.5 >>> t.minKey(1.5) # smallest key >= 1.5
2 2
>>> for k in t.keys(): >>> [k for k in t.keys()]
... print k, [1, 2, 3, 4]
1 2 3 4 >>> [k for k in t] # new in ZODB 3.3
>>> for k in t: # new in ZODB 3.3 [1, 2, 3, 4]
... print k, >>> [pair for pair in t.iteritems()] # new in ZODB 3.3
1 2 3 4 [(1, 'red'), (2, 'green'), (3, 'blue'), (4, 'spades')]
>>> for pair in t.iteritems(): # new in ZODB 3.3
... print pair,
...
(1, 'red') (2, 'green') (3, 'blue') (4, 'spades')
>>> t.has_key(4) # returns a true value, but exactly what undefined >>> t.has_key(4) # returns a true value, but exactly what undefined
2 2
>>> t.has_key(5) >>> t.has_key(5)
...@@ -242,11 +238,11 @@ structure is stored to a database, though. ...@@ -242,11 +238,11 @@ structure is stored to a database, though.
... pass ... pass
... ...
>>> a, b = C(), C() >>> a, b = C(), C()
>>> print a < b # this may print 0 if you try it >>> print(a < b) # this may print 0 if you try it
True True
>>> del a, b >>> del a, b
>>> a, b = C(), C() >>> a, b = C(), C()
>>> print a < b # and this may print 0 or 1 >>> print(a < b) # and this may print 0 or 1
False False
>>> >>>
...@@ -334,9 +330,13 @@ Example ...@@ -334,9 +330,13 @@ Example
>>> list(s) >>> list(s)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> for i in s: # the output is undefined >>> for i in s: # the output is undefined
... print i, ... print(i)
... s.remove(i) ... s.remove(i)
0 2 4 6 8 0
2
4
6
8
Traceback (most recent call last): Traceback (most recent call last):
File "<stdin>", line 1, in ? File "<stdin>", line 1, in ?
RuntimeError: the bucket being iterated changed size RuntimeError: the bucket being iterated changed size
...@@ -353,9 +353,18 @@ of the keys. Example ...@@ -353,9 +353,18 @@ of the keys. Example
>>> from BTrees.IIBTree import * >>> from BTrees.IIBTree import *
>>> s = IISet(range(10)) >>> s = IISet(range(10))
>>> for i in list(s.keys()): # this is well defined >>> for i in list(s.keys()): # this is well defined
... print i, ... print(i)
... s.remove(i) ... s.remove(i)
0 1 2 3 4 5 6 7 8 9 0
1
2
3
4
5
6
7
8
9
>>> list(s) >>> list(s)
[] []
>>> >>>
......
...@@ -36,7 +36,7 @@ deps = ...@@ -36,7 +36,7 @@ deps =
[testenv:docs] [testenv:docs]
basepython = basepython =
python2.7 python3.7
commands = commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
......
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