Menu

New: version 1.1 of the Pythonizer

The new version of the Pythonizer has a few enhancements:

  1. Recognition of non-static methods in the Java source and conversion to Python methods. This was a grave omission in the original Pythonizer, but to tell the truth, it's been a long time since I wrote a method in Java. I now tend to write procedurally, so the legacy code for which the Pythonizer was designed only contained static procedures. This omission has now been corrected: all non-static procedures are given an extra "self" parameter, and Java "this" is translated to Python "self".
  2. The treatment of non-public names has been improved. These now all get an initial underscore, as per PEP8. Because the Pythonizer allocates attributes to names irrespective of their position in the source file, this may result in a public name that duplicates a non-public name being underscored. Well, tough luck! A little editing on the Java source will fix this.

In general, no guarantee is given that the translated code will be valid Python or will run correctly. But my experience has been that small changes to the Java source or the resulting Python source will sort any problems. It's much quicker than hand translation, that's for sure!

If you think there are still serious errors in the Pythonizer, please contact me by email on:

talkguibits@gmail.com

Posted by Richard Bosworth 2022-05-30

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.