[New-bugs-announce] [issue9541] node.pre_order() does not do preorder traversal

Joe Amenta report at bugs.python.org
Sun Aug 8 06:08:19 CEST 2010

New submission from Joe Amenta <amentajo at msu.edu>:

In Lib/lib2to3/pytree.py, Node.pre_order() calls the post_order() method of its children, instead of pre_order().  As a result, the only difference between the two orderings is that pre_order() yields the original node first, whereas post_order() yields the original node last.  It seems highly unlikely to me that any code would depend on this behavior.

The fix, of course, is trivial: change the call to child.post_order() on line 289 into a call to child.pre_order().

components: 2to3 (2.x to 3.0 conversion tool)
messages: 113233
nosy: joe.amenta
priority: normal
severity: normal
status: open
title: node.pre_order() does not do preorder traversal
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list