Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Pythonista - should you care about python 2.7 or not?
-
Is there a community feeling about when writing new code about backward support for py2.7 if you are using py3.5 and you are starting new programs regardless how trivial? Seems like the adoption rate of py3 generally is getting traction now. I realise it's a personal choice. I just wondered if there was a standard Etiquette.
It seems to me for new code, no reason to support 2.7 at all.
I am sort of thinking out aloud, maybe there is no answer -
When I write a script, it's for my personal use, thus I only try to run it in Python 3 and I have converted all my "old" scripts, thus I agree with you.
-
@cvp , what if you are writing a class or module you want to share?
-
I agree to share all my scripts (of course some ones are very personal thus unuseful for others) but why to spend time if nobody needs to run it in Python 2.7?
Eventually, I could help if really needed.For instance, I've written, for a friend who has a service company, a big script of more than 4000 lines (sure @ccc could improve it 😇) that i'll never try to modify for supporting 2.7 because this script is really linked to my friend"s company.
-
I guess, it is a bit field related. At least that is the picture I got. For example in a scientifical environment supporting 2.7 or even 2.5 ist still a big plus because the (misguided ) notion that 2.7 is much more performant when it comes to huge chunks of data is still very popular. But if you look at some general data two things become eveident to me:
Firstly, Python is still the fastest growing platform compared to other languages (see here for example [1]). I just read an (hilarious ) article some time ago that pointed out that if we keep using python at this rate we will have to write by 2050 our cook books in python (which would be fine by me). Sadly i cannot find it anymore. Growing base means new users, which again could lead to the conclusion that most of them will choose the newer version or at least are more open to it.
The second thing is that while when it comes to total number of downloads Python 2.7 is still by more than a magnitude ahead, it was 2017 when 3.x overtook 2.x in annual downloads (see here for more Details [2]). As you said in the end it is a very personal choice. I personally like 3.x very much and so not see the point of supporting 2.7 but there will be plenty of people who will disagree with me on that.
[1] http://pypl.github.io/PYPL.html
[2] https://hynek.me/articles/python3-2016/ -
I've mostly stopped making my personal projects (public or not) Python 2-compatible a while ago, about when Pythonista 3 came out.
:)
Almost any new code I write is Python 3 only, mostly even 3.5 or 3.6 only, so I don't have to restrict myself in what features I can use. I haven't ported over most of my old Python 2 code though, such as the things on https://github.com/dgelessus/pythonista-scripts. Many of the scripts there are so old that nobody cares about them (including myself) so I don't really have a reason to update them.I'm okay with writing backwards compatible code though, especially if it's for an existing codebase that already supports an older version. If it doesn't take much effort and doesn't cause any major issues, I prefer to keep backwards compatibility. If I was in charge of a library with more than three or so uses, I probably wouldn't drop Python 2 support. At least not until 2020, when Python 2.7 is officially unsupported and stops receiving security updates. That is a well-known date, and people still have three years to move to Python 3 if they haven't started yet. At that point I think it's fair to let go. (See http://python3statement.org/.)
-
Thanks for your insights. Nice to read them to get an understanding what is driving your opinions/choices. The posts are so surprising to me, but that's a good thing. It seems to me that the resistance to py3 is coming to an end. But it's only my perception, that's why I asked the question
-
You can keep track of your own favorite statistics about the migration towards Python 3... https://langui.sh/2016/12/09/data-driven-decisions/
-
I have mostly been using Py2 because of the craziness of bytes and strings being separate things now.
Also generally there are more libs still on only 2.. (Or both) -
I find it sane that bytes and strings are not interchangeable. So do most programming languages created after Python 3 (such as Node, Swift, Go, Rust). Which libs that are important are incompatible with Python3?