[Python-porting] "compiler" module in Python3k

Georg Brandl g.brandl at gmx.net
Sat Nov 6 19:02:56 CET 2010


Am 06.11.2010 16:34, schrieb Zubin Mithra:
> Hello everyone!
> 
> I am currently working on porting a library over to Py3k and I am required to
> replace the compiler module as it does not exist in 3.1. I tried replacing the
> compiler module with the ast module, however that does not meet my requirements.
> 
> I need an analogue for compiler.parse.getChildren in Python3k. Any ideas? Thanks
> a lot.

ast.iter_child_nodes together with ast.iter_fields seems to do what you need.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-porting mailing list