Visual Paradigm in my opinion is a great product, but its Python reversing gives me headaches. I frequently have gotten (presumed) syntax errors or even internal parsing errors. I entered several tickets on Python reversing in the past. Often the problem would be fixed quickly, but sometimes not, or other bugs would be introduced while fixing the initial one.
When I ran into reversing errors again the last days, I created a small helper script, now at https://hg.sr.ht/~sschwarzer/python_skeleton . Tickets can be entered at https://todo.sr.ht/~sschwarzer/python_skeleton . This script – at least at the moment – won’t give you the types from the type hints, but at least it should get the code (the stub code generated by the script) reversed.
Dear Visual Paradigm team, I have the following suggestions:
Please support reversing for Python 2 and 3 as two separate options. Don’t try to combine Python 2 and 3 in a common “Python code”.
Use the official grammars from the Python project or existing Python parsers for Java. Don’t fix individual reversing bugs case by case.
For testing, try to reverse the standard library for each Python version. If this succeeds without errors, I think it’s very likely that almost all source code in the wild will be parsed correctly as well. If you want your code to be even more robust, include the unit tests for the respective Python versions in your reversing tests.
Although Python 2 support from the CPython team officially ends on 2020-01-01, this doesn’t mean you shouldn’t invest time in Python 2 reversing support. Many projects have delayed their migration to Python 3, and when they’ll tackle it eventually, they’ll be very thankful if they can reverse their legacy Python 2 code to get an overview for the Python 3 migration.