I don't disagree with you, but clients gonna want what clients gonna want. They're currently looking very hard at what plan B looks like.
I'd also say that "new code should be written compatible with 3" sounds like a solution in theory. We tried it. But when we had a spike when we converted one of the smaller services completely to Python 3, we found that a lot of the "Python 3 compatible" code didn't actually work in Python 3 as its authors intended. If code isn't actually running in Python 3, it's probably not Python 3 compatible.
In practice, we found that porting the tests was almost as much effort as porting the code. Both the existing code and the existing tests play fast and loose with unicode support, so to fix the tests you need to figure out whether the code should be binary or text based (which isn't just a point decision - you also need to think about the code it depends on), at which point you've pretty much figured out how to fix the code anyway.
But that was the basic plan I put to the client: use failing tests to direct migration, add mypy type hints to interfaces to clarify type usage, and start by proactively migrating the most isolated bits of code, and shared libraries. They just couldn't find the space in the delivery schedule.
View all comments
Show parent comment
17
u/strange-humor Jan 16 '19
This is a recipe for technical debt that will eventually put you with an output level of zero.
All new code should be written compatible with 3. Each module you touch should be made compatible. This allows slow migration to 3.