Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I disagree, I think Django dropping support for 2 will actually push more open source projects to do the same. This will create the momentum and incentive necessary to nudge people over the edge and upgrade.

There is an awful lot of hyperbole around the difficulty of upgrading from python 2 to 3, however with the latest changes in 2.7 and 3.6 the gap isn't as big as you expect. I converted our (admittedly not massive) 35,000loc Django project from 2 to 3 in about four hours, starting with with 2to3 tool then working though test failures it wasn't nearly as bad as I was expecting. Most of the issues were as I expected around the new string handling, but as soon as something broke, I knew before looking at the code what the problem was.



>There is an awful lot of hyperbole around the difficulty of upgrading from python 2 to 3

+1. IMO this is the 2nd most overblown python issue next to the GIL.

It's also not actually that difficult to maintain code that works on both.

Upgrading Django OTOH has caused me quite a bit more pain over the years.


Very true, upgrading from 2 to 3 was an easer change than a couple of the last Django upgrades - and we are doing those every 9 months...


Agreed. We've got a ~100k line Django project and I'm fairly confident it won't be more than a day or so of work to migrate. The only thing keeping us on 2.x is our dependencies most of which already have Python 3 support so it's really just a matter of us upgrading dependencies.


One day sounds impressive. What's your strategy?


- Most of it can be automated with 2to3.

- We already have linting in place that encourages Python 3 compatibility (and have no linter warnings on master).

- We already use six for moved modules.

- And we have a test suite that is not exhaustive, but 'good enough' to find the common patterns of bug for this kind of thing.

- We also have a style-guide that favours the ability to find-replace project wide with relative safety.

- We don't have much 'math heavy' code that will fail with the changes in operations in Python 3.

- We already use unicode for the majority of strings.

- We don't use my Python networking code directly, it's mostly just Requests (so a lot of the moved modules don't apply).

This excludes the upgrading of dependencies, I think that's where we will spend more time, but the actual Python 3 transition for the main codebase should be ok, mostly because of the effort we've put into style and review since it started ~5 years ago.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: