I like this idea and disappointed it always gets a negative reaction. One of my biggest peeves is this: import datetime # or from datetime import datetime Which is often confusing... is that the datetime module or the class someone chose at random in this module? A minor thorn that… just doesn't go away. On 2021-11-11 07:38, Eric V. Smith wrote:
The costs of migration are also too high. I personally work on a 20 year old proprietary python code base that would never be updated for a change like this.
like: "str = 'foo'". But even if a perfect tool existed, it would take man-months and many tens of thousands of dollars to test such a large code base. My clients are understandably unwilling to do that for no functional gain.
My current work is on a ~15 year old code base. Had to do a number of upgrades over the years. 2.x to 3.x was the big one. Luckily there was not a lot of text encoding work so porting was straightforward, and the project was improved for the effort. Despite the failures and grumbling there are success stories as well. A lot of folks are understandably hesitant at repeating the 2 vs 3 divide. But I think some learned the wrong lesson from that experience. The lesson wasn't that we shouldn't improve anything, but that we shouldn't change anything *fundamental.* Fundamental improvements generally can't be automated, they sometimes have to be rebuilt from the ground up. I agree that's a no-go. But this thread is about a rename with aliases for compatibility. Recently we brought the same project from the ~3.5 era to 3.8 idioms using the tool pyupgrade. Have you tried it? Made short work of moving forward. Project is now more readable, using better language features. It took a few hours from an existing maintenance budget—not tens of thousands of dollars. Not only that, (combined with other refactoring) the code is more fun to work on now. Yes, you read that right, enjoyment has increased due to improved readability, appearance, and quality. No, we couldn't afford to rewrite it from the ground up. But, running a tool to fix the case of a few confusing names is a small win for a small cost. I would like to continue the process. +1 for stdlib, not including typing scope creep, -Mike