summaryrefslogtreecommitdiff
path: root/doc/tutorial.txt
diff options
context:
space:
mode:
authorscoder <none@none>2007-09-15 19:30:58 +0200
committerscoder <none@none>2007-09-15 19:30:58 +0200
commit2a7ba24a511a7698fcf08e1fa3a1f06d4d86f53f (patch)
tree5651762d6b5201d6d94ffff8d0dddb6b620c9b5e /doc/tutorial.txt
parentb705be35fd370e8db10ffc4cff4d9336e8cad1fc (diff)
downloadpython-lxml-2a7ba24a511a7698fcf08e1fa3a1f06d4d86f53f.tar.gz
[svn r2874] getchildren() deprecated
--HG-- branch : trunk
Diffstat (limited to 'doc/tutorial.txt')
-rw-r--r--doc/tutorial.txt16
1 files changed, 2 insertions, 14 deletions
diff --git a/doc/tutorial.txt b/doc/tutorial.txt
index ae095a51..17c75125 100644
--- a/doc/tutorial.txt
+++ b/doc/tutorial.txt
@@ -125,6 +125,8 @@ possible, elements behave like normal Python lists::
>>> print len(root)
3
+ >>> children = list(root)
+
>>> for child in root:
... print child.tag
child1
@@ -173,20 +175,6 @@ library::
>>> print [ c.tag for c in root ]
['child3', 'child1', 'child2']
-To retrieve a 'real' Python list of all children (or a *shallow copy* of the
-element children list), you can call the ``getchildren()`` method::
-
- >>> children = root.getchildren()
-
- >>> print type(children) is type([])
- True
-
- >>> for child in children:
- ... print child.tag
- child3
- child1
- child2
-
The way up in the tree is provided through the ``getparent()`` method::
>>> root is root[0].getparent() # lxml.etree only!