New submission from Joe Amenta <ament...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue9541>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to