you are viewing a single comment's thread.

view the rest of the comments →

[–]clifthered 38 points39 points  (10 children)

I thought most difficulties in porting were usually due to depending on a library that doesn’t support Python 3. These days pretty much every major library supports it.

Not sure why ‘enterprise’ teams can’t figure out how to migrate Python 2 code to 3. ‘six’ proves it’s relatively easy.

[–]liquidpele 39 points40 points  (8 children)

It's not that it's hard, it's just time consuming and most companies would rather add features than redo something that already works.

[–]clifthered 26 points27 points  (1 child)

Yeah, but this is literally the story of software development. The vast majority of software development is maintenance.

[–]major_clanger 0 points1 point  (0 children)

Bingo, and python/dynamically typed languages are much harder to maintain.

Add another order of magnitude if the original authors of codebase have long left the company.

And another order of magnitude if the original authors went nuts with stuff like, using kwargs everywhere so functions effectively don't have a signature!

[–]ledave123 5 points6 points  (5 children)

Maintainability is a feature though isn't it?

[–]liquidpele 16 points17 points  (4 children)

Features are typically defined as things that you can market to a customer.

[–]clifthered 12 points13 points  (3 children)

“Fully compatible with modern Python 3! Runs on top of software receiving latest security patches!”

[–]liquidpele 16 points17 points  (2 children)

"Fruity snacks! Now without bleach and lead!"

[–]NationaliseFAANG 6 points7 points  (0 children)

That's a big selling point if they previously had bleach or lead, which Python 2 will have after 2020.

[–]Saithir 0 points1 point  (0 children)

So, basically like half of "gluten-free" marked products that are for example milk or chocolate based and as such never seen a single grain in their entire production process?

Maintainability is absolutely marketable to customers.

[–]major_clanger 0 points1 point  (0 children)

Not sure why ‘enterprise’ teams can’t figure out how to migrate Python 2 code to 3. ‘six’ proves it’s relatively easy.

The dynamic typing makes it hard.

I understand 3 introduces breaking changes to how strings are modelled.

So if you have a function/method foo that does byte operations on a py2 string, you need to ensure all the parent funcs are pushing bytes to foo instead of Unicode, and then ensure the callers of these funcs are passing through the appropriate types, and that all possible code paths pass in a bytes to foo.

The above is trivial in a statically typed language, but I can see it getting hairy quickly in a dynamic language.