Hacker News new | ask | show | jobs
by altano 3678 days ago
I just recently started learning Python for the first time, and at some point I switched from playing with 2.7 to 3.x, and my uninformed opinion is that I'm shocked at how many seemingly completely unnecessary breaking changes there are.

Did the parameter names to open()d really need to change? Why did I have to change from io.open() to open() for a stream? Did str.lowercase really need to become string.ascii_lowercase? The number of errors in my toy little program upon upgrading really surprised me.

2 comments

Python 3.0 was basically a line in the sand to throw in all these "unnecessary" breaking changes. At the end of the day, no changes are actually necessary.

But to keep Python improving without weighing itself down, some changes couldn't just be slipped into the 2.x series. Because they're fundamental enough changes to even effect toy programs.

So, yes, I'd say that the default string type did need to change from bytes to unicode. And not only do I not miss str.lowercase, that kind of vestigial feature is exactly the type of thing that should be purged with the unicode transition.

Language changes rarely make anything better or even worth doing. But they are very easy to do and so they are the things language developers usually want to do and want to play with. Asking the hard questions will only make you disappointed in them.