Live data from Hacker News

Removing Python 2.x support from Django for version 2.0

github.com

341–350 of 413 posts

Re: Removing Python 2.x support from Django for version 2.0

#341

Earlier quoted context omitted.

Because one is essentially EOL?

Well, I'm for user driven EOL, as opposed to top-down, we-know-better EOLining. And the latter doesn't work so well thus far for Python 3.

I think you see this argument used a lot when it comes to Python 3 about it not working so well. I don't see the maintainers changing their minds about EOL on python 2 so either switch to Python 3 or to another language. There is so much toxicity around the Python community because of people thinking they are entitled to have everyone still support Python 2.

Re: Removing Python 2.x support from Django for version 2.0

#342
post #331

Earlier quoted context omitted.

Ruby also BROKE A LOT LESS, and offered immediate, tangible reasons to upgrade.

The reasons to upgrade are often dependent upon your usage case. To me, the Unicode improvements are reason enough on their own before you even get into the other great stuff (async work, type hinting, stdlib cleanup, pyc rework, etc). asyncio is going to be a slow build, as the ecosystem starts unifying around it. But as that happens, we'll be much better off for it.

Ruby offered an immediate 25% performance increase. That's a lot less niche than Unicode.

Re: Removing Python 2.x support from Django for version 2.0

#343
post #334

Earlier quoted context omitted.

Oh they do break, but it's a much slower process than RoR (as you described) IIRC the most impacting changes I remember were in Config, replacement of South with a native solution and some timezone issues

The upgrade process of south was pretty shitty. The documentation was telling something like: Ensure you applied all previous migrations and then start from scratch. Thats not an upgrade path. It may work for standalone web applications, but I have a python project (packaged as deb/rpm package and using the packaged django version of different distributions) that should work with multiple django versions and the user…

If you were supporting applications which needed to work with or without South at the time of the transition, the best thing to do was probably ship two separate sets of migrations (one set written for South, one written for Django's built-in migration framework).

Re: Removing Python 2.x support from Django for version 2.0

#344

Earlier quoted context omitted.

> instead of rethinking/refactoring. And breaking backwards compatibility Django is not RoR. Their users rely on being able to upgrade seamlessly. The overall Api makes sense, there are some rough corners (yes Sites, I'm talking about you) the docs are ok once you get the hang of them

When you say "Django is not RoR", are you saying Django doesn't break backwards compatibility but Ruby on Rails does? If so, I have to very strongly disagree. It's almost mind boggling to me how much they break backwards compatibility as a framework. They usually warn users with a deprecation warning in one version and then they make the backwards incompatible change in the next version, but the sheer amount of these…

I've upgraded a large (~700K LOC) Django project across several versions (1.5-1.9). I think Django does a reasonably good job of maintaining a good upgrade path, though they frequently break backwards compatibility, and at a pretty fast rate (now 8 months release cycles, which barely gives the community to catch up). Some of the changes like module renames seem pointless from an end user perspective, so it feels like the django core team shovels busywork onto users. I also find their method naming policies annoying, since they don't annotate "unsupported" features in any way (eg with an _attribute, and also some _attributes ARE supported). This makes it difficult to figure out whether you're "staying within the lines" of their support policy. I keep a checkout of the django repo around so I can grep the docs for mentions of a method before I use it.

That said, having started on updating that same codebase to Python 3, the Django team tries hard to provide the KEY thing you need to seamlessly update a codebase: a version which can support both incompatible features. Without this, you need to have one giant branch with a bunch of renames and other changes. They actually introduce deprecation warnings, and have something non-deprecated you can use in the same version. I think if Python core had introduced a version of Python including both versions of all the module renames with deprecation warnings, the community would be much further along on the upgrade path.

Re: Removing Python 2.x support from Django for version 2.0

#345

Earlier quoted context omitted.

How else would you introduce backwards incompatible changes? Especially with the LTS upgrade path that alasdairnicol mentioned I wonder what there is still to improve.

Mark it as deprecated, change the documentation to tell the user to use the new function Y instead and the most important part: keep the old api even if it's crufty. Wait for a few years until everyone upgraded and no longer uses any deprecated functions. Maybe make a final LTS release for those who don't want to upgrade. Then and only then should you ever break backwards compatibility.

Wait for a few years until everyone upgraded and no longer uses any deprecated functions.

Then view HN threads of people saying they have thirty-million-line codebases which utterly rely on deprecated functionality and they never ever plan to upgrade or do even basic maintenance ever for any reason ever, and will abandon your platform and completely rewrite in something that treats them "better".

Re: Removing Python 2.x support from Django for version 2.0

#346

Earlier quoted context omitted.

> Many of the science libs want to use seem to be in 2.7 with no signs of moving The most important scientific libraries have pledged to drop support before 2020, and are all python3-ready http://www.python3statement.org/

Is Numpy on that list?

Yep:

  % python --version
  Python 3.5.2

  % pip install numpy
  Collecting numpy
      Using cached numpy-1.12.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
  Installing collected packages: numpy
  Successfully installed numpy-1.12.0

Re: Removing Python 2.x support from Django for version 2.0

#347

I have a Python 2.7 project that has been running smoothly for many years now and I'm having trouble finding a reason to upgrade to Python 3. The project uses the unicode type to represent all strings, and encodes/decodes as necessary (usually to UTF-8) when doing I/O. I haven't really had any of the Unicode handling problems that people seem to complain about in Python 2. Can someone explain what benefit I would act…

Here you go: https://eev.ee/blog/2016/07/31/python-faq-why-should-i-use-p...

Re: Removing Python 2.x support from Django for version 2.0

#348
post #279

Earlier quoted context omitted.

I don't have any projects using Django but they have an LTS model - surely you don't need to update to avoid being vulnerable? Just security patches?

For three years, if you release your project the day the LTS comes out.

Django releases tend to add useful features/optimizations, and have very light upgrade effort. Most devs will WANT to upgrade to the latest stable.

Re: Removing Python 2.x support from Django for version 2.0

#349

Earlier quoted context omitted.

Is Numpy on that list?

Yep: % python --version Python 3.5.2 % pip install numpy Collecting numpy Using cached numpy-1.12.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Installing collected packages: numpy Successfully installed numpy-1.12.0

That are dropping Py2 support, I mean.

Re: Removing Python 2.x support from Django for version 2.0

#350

Earlier quoted context omitted.

Python 2.7.9 Release Date: 2014-12-10 https://www.python.org/downloads/release/python-279/

2 years is not an unusual time between starting product development and seeing any sort of major customer uptake, and if you're in that time period, your priority really should be getting the customers rather than futzing with code migrations.

It's still the case that a bad call was made when the codebase was started, picking a language version that was already on its way out. It's like starting a new project now with Java 7 o .Net 2.0.
Post reply on HN