summaryrefslogtreecommitdiff
path: root/doc/tutorial.txt
diff options
context:
space:
mode:
authorscoder <none@none>2008-05-04 20:24:47 +0200
committerscoder <none@none>2008-05-04 20:24:47 +0200
commitfa81a2eef067c5c519353a3882f7f02bde90c35a (patch)
treeadb5f1a7df7925969d17850e4d4d971c8a2c286d /doc/tutorial.txt
parentbd1aead5333b4666660a9524e68d1514517b4558 (diff)
downloadpython-lxml-fa81a2eef067c5c519353a3882f7f02bde90c35a.tar.gz
[svn r3641] r4154@delle: sbehnel | 2008-05-04 20:23:11 +0200
simplified doctest --HG-- branch : trunk
Diffstat (limited to 'doc/tutorial.txt')
-rw-r--r--doc/tutorial.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/tutorial.txt b/doc/tutorial.txt
index 778b5a59..923a9c65 100644
--- a/doc/tutorial.txt
+++ b/doc/tutorial.txt
@@ -774,12 +774,12 @@ will block and wait until data becomes available in this case:
.. sourcecode:: pycon
>>> class DataSource:
- ... data = iter(["<roo", "t><", "a/", "><", "/root>"])
+ ... data = ["<roo", "t><", "a/", "><", "/root>"]
... def read(self, requested_size):
... try:
- ... return self.data.next()
- ... except StopIteration:
- ... return ""
+ ... return self.data.pop(0)
+ ... except IndexError:
+ ... return ''
>>> tree = etree.parse(DataSource())