Hacker News new | past | comments | ask | show | jobs | submit login

No, there's no reason Python 2 can't have these features, but there's no particularly compelling reason to invest the engineering effort to develop it.

> the mess they made with Python 3

What mess, exactly?

> what was an originally bad idea.

What makes Python 3 a "bad idea"?




> What makes Python 3 a "bad idea"?

Breaking compatibility with a huge code-base for incremental features.


The move to Unicode is not "incremental" by, like, any measure. And other things, like moving `print` to be a function instead of a statement, were absolutely good design choices and worth breaking for.

People have had plenty of time to work on porting their code from 2.x to 3.x. Honestly, I think it's remarkable the devs kept maintaining 2.x as long as they did. I mean, look at Swift, where they had breaking changes year after year, and yet their user base has fairly exploded since the language's release not so long ago.

Just... get on with it, you know? Move to Python 3.x and be done with it. There's no particularly good reason to stick to 2.x forever.


Unicode alone is worth moving.

I'm not particularly excited about a lot of other new features though.

I don't see a real reason for type annotations from my perspective (if I wanted typed I'd use a typed language, if I wanted types indicated I'd indicate in the doc strings).

Also f-strings which I haven't used it. They probably are better, but I'm barely getting used to `format` as opposed to `%s` (which admittedly `%s` does suck as I've said many time while counting items on the screen with a pencil).


> I don't see a real reason for type annotations from my perspective (if I wanted typed I'd use a typed language, if I wanted types indicated I'd indicate in the doc strings).

I definitely get this perspective, but I actually use type annotations a lot. I do the vast majority of my Python development in PyCharm, and using type annotations greatly facilitates auto-complete features. It also helps me do some very simple debugging while writing, as the IDE will tell me "Hey! I don't think these types match up!", which is often enough to save me the headache of debugging.

Realistically, I just want Python but with a static type system. Which is why I'm implementing that as my own project haha.

> Also f-strings which I haven't used it.

Oh, dude, you gotta get on board with f-strings. They're soooo much simpler than the alternatives. Just skip learning `.format` and go straight to f-strings. I moved to f-strings when they first became available a few years ago and haven't looked back since.

Dataclasses are also great, IMO. I prefer algebraic data types in functional languages like Haskell or OCaml, but I think Python's dataclasses are a "good enough" solution for me to use in the meantime. I often define very simple data types and hate the default `__repr__` implementations and writing naive `__init__` functions. Dataclasses make all this much faster and, I think, more readable.


There's no question that Python 3 is an improvement, but the question is whether it's an improvement worth breaking every existing Python app. Especially when many of Python 3's features could easily have been backported to Python 2. Python 3 is effectively a new language. People will be running Python 2 for many more years to come.


Don't need to skip learning format. f-strings are a terser version of the .format call with a bit of superset features thrown in.


Ah, yes, I just meant they shouldn't focus on using `.format` and should instead just use f-strings directly. Didn't mean to imply that they were totally separate things, though that's definitely how my phrasing came across.


format has been around for a decade, and you're just getting used to it?


Yep, the other way is easier (if, and only if it's short), it has simpler rules, less typing, and that's how I learned it and it's in muscle memory without having to stop and think or look at examples.


> The move to Unicode is not "incremental" by, like, any measure.

The unicode improvements in Python 3 are definitely a step in the right direction. But there were certainly good ways of improving unicode issues without breaking compatibility. Things like print are a joke, no one should care about its semantics.

> Just... get on with it, you know? Move to Python 3.x and be done with it.

Pretty easy to say. But try convincing product managers to take 5 devs off their current projects for 6 months to port a working production app to a newer programming language, with little concrete evidence that it will have a meaningful impact on the project (other than introducing bugs).




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: