[Python-3000] 2to3 pattern syntax

Brian L. Troutwine goofyheadedpunk at gmail.com
Wed Jan 10 22:03:33 CET 2007


As the refactoring tool for the 2 to 3 transition was mentioned some time ago 
on this list I hope that this is the correct list to post questions about the 
tool. I apologize if this isn't, of course.

My questions are entirely concerned with the pattern matching syntax. The 
problem is, it would seem, I don't understand a thing about them.

Is the following incorrect for matching pass statements? If so, why?

    pass_stmt< 'pass' >

If I wanted to append to each matched pass statement, say, the string "# This 
is a comment" how would the transformation have to be structured?

If I wanted to match a function structure what would the proper pattern be? 
How about classes?
-- 
Small is beautiful.
		-- Schumacher's Dictum


More information about the Python-3000 mailing list