It isn't bad, but the required effort does scale with the size of your code base. 2to3 only covers some basics, many behavioural differences are more subtle. And python being interpreted you'll discover errors at run time, so will need good test coverage or do a lot of testing.
Futurize did more harm than good when we tried it. It tries to paper over the genuinely different string semantics, and left us with something broken that we understood even less than what we started with.
Modernize is more conservative, and in our experience, gives a better starting point. If you've got a big codebase, you've still got an uphill battle ahead of you.
Also, use mypy type hints. In general, I hate them, but they're really helpful for clarifying type usage in legacy codebases.
Hmm, thanks for the tip! I've use futurize --stage1 a fair bit but never really liked the second stage... though just getting syntax-compatible with Python 3 allows many more tools to work.
3
u/kastoro May 30 '19
Fine, I will do it!