Is there a parser that:
- is able to parse
Python2.6+code, and - can be run in
Python2.5(python-only, noCextensions allowed)?
NOTE: This is somewhat related to my previous quostion about class decorators.
Is there a parser that:
Python2.6+ code, andPython2.5 (python-only, no C extensions allowed)?NOTE: This is somewhat related to my previous quostion about class decorators.
Yes, lib2to3 can, all you need to do is to provide it with the right Grammar file (get the source code for the Python you want and copy Grammar/Grammar).
Python 2.7 code to Python 2.5 using lib2to3 from the 2.7 stdlib, and an import hook that does the conversion on-the-fly: github.com/aatiis/seven