this post was submitted on 06 Oct 2023
65 points (94.5% liked)

Python

6343 readers
15 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] JigglySackles 5 points 1 year ago (3 children)

I don't do enough for it to matter, what's wrong with 3?

[–] [email protected] 8 points 1 year ago (1 children)

It's different enough.

There are huge python 2 codebases that can't easily be ported to python 3.

[–] Vamanos 10 points 1 year ago (1 children)

Meh. I’ve ported a fair many py2 projects to 3. At this point just bite the bullet. Even from a security standpoint. Trying to not let my bias seep through - but it’s been so long.

[–] [email protected] 15 points 1 year ago (2 children)

Ever worked on a giant corporate codebase? I'm not saying you're wrong, but corporate internals often work counter to common sense or sanity. You'll have a giant mess of code, that would require months of work to port. The longer you wait, the more expensive it will get, but if you just wait long enough, it might not be the current manager's problem anymore. So it will be postponed and postponed.

I've seen this in real life a few times. EOL driven development. You just wait until it's absolutely impossible not to upgrade, then you hastily stop everything, do the porting in a marathon of sadness that basically rewrites everything, and if you're done, you can wait for the next EOL.

[–] Vamanos 6 points 1 year ago* (last edited 1 year ago) (1 children)

20 years on giant enterprise codebases. And any enterprise worth their salt at this point will be scanning these servers and flagging eosl software.

My experience the last five years of the 20 - security and service life trumps all fucking complaints about complexity.

To the point where it’s the opposite and I’m fielding weekly questions about why we’re still running an older 3.7.9 version. Among 50 other things.

[–] [email protected] 3 points 1 year ago

Yet, there are enough companies that simply don't care. Yes, that's bad, but it's also reality.

[–] [email protected] 5 points 1 year ago (2 children)

The trick is to assign someone the responsibility of the upgrade and give them the authority to tell the other developers how their newly added code shall look like. This will get you there eventually.

Seen it work on a >1 million SLOC project.

[–] [email protected] 7 points 1 year ago

Yeah but that requires good planning and better team structure.

That's low margin and therefore doesn't happen often enough.

[–] [email protected] 1 points 1 year ago

This will get you there eventually.

Only if you can actually upgrade piece by piece. In a monolith, you often enough can't just upgrade new lines/methods. In those cases, it's halt all development, pull everyone into upgrading and then continue.

[–] Narann 1 points 1 year ago

Nothing, because it's not related to Python 3.

[–] [email protected] -2 points 1 year ago (1 children)

Python 2 had one mostly-working str class, and a mostly-broken unicode class.

Python 3, for some reason, got rid of the one that mostly worked, leaving no replacement. The closest you can get is to spam surrogateescape everywhere, which is both incorrect and has significant performance cost - and that still leaves several APIs unavailable.

Simply removing str indexing would've fixed the common user mistake if that was really desirable. It's not like unicode indexing is meaningful either, and now large amounts of historical data can no longer be accessed from Python.

[–] JigglySackles 1 points 1 year ago (1 children)

Thanks for that context. Seems odd that they would remove the str instead of taking the time to fix it.

[–] [email protected] 1 points 1 year ago

It's because unicode was really broken, and a lot of the obvious breakage was when people mixed the two. So they did fix some of the obvious breakage, but they left a lot of the subtle breakage (in addition to breaking a lot of existing correct code, and introducing a completely nonsensical bytes class).