132
u/SketchyMikePemulis May 30 '19
print("good riddance")
75
u/Zomunieo May 30 '19 edited May 30 '19
from __past__ import print_statement
print "glad this is gone?" >> sys.stderr
21
75
u/alcalde May 30 '19 edited May 30 '19
OK, where's the person here who keeps telling me that the PSF is definitely going to extend the deadline again?
25
3
56
u/captain_cashew May 30 '19
My company is moving from 2.6 to 2.7! Yay!
32
31
u/regeya May 30 '19
I went into a local company to do some contract work, and found out not only are they still using Visual Basic 6, they were talking about moving to VB.net someday. They wanted a static website to be built, but only if I could build it in a specific piece of discontinued Adobe software, and another website to be modernized that was built in Google Sites.
I just pretended that meeting never happened.
12
u/alcalde May 30 '19
That was me at Bed Bath and Beyond HQ in 2005, when I encountered Access 97 and Impromptu 5 (Impromptu had been discontinued at version 8). They were also using VB6 for internal development. I stayed six months.
2
10
u/i9srpeg May 30 '19
Are you enjoying your fancy new dict comprehensions?
11
u/captain_cashew May 30 '19 edited May 31 '19
Your comment comes at a very appropriate time. Literally just a few minutes ago found a bug on one of our systems using 2.6 (my local development station is on 2.7):
{k: v for (k, v) in dict.items()}You have to use:
dict((k, v) for (k, v) in dict.items())So, yes I am enjoying them!
EDIT: code format
2
u/flying-sheep May 31 '19
If a thing has an
itemsmethod, you can just dodict(thing)to create adictcopy. If it’s a dict, you can dothe_dict.copy(). You only need comprehensions if you have to construct keys and values in a more complex way.1
u/nieuweyork since 2007 May 31 '19
To me this is an argument against the Python developers' increasingly profligate addition of syntax. There's almost never one obvious way to do it these days.
1
5
u/gruey May 30 '19
I still think that it was a huge mistake from Python not to just bite the bullet and create some kind of Python 2-3 interpreter like a decade ago when it became obvious there was just too much momentum against moving to 3.
Basically something that'd let you mark it and all of its dependencies as 2.7, do some fairly thorough translation that gets 99.8% of the existing code and ideally warning about things it felt it couldn't translate. Some performance loss would be acceptable. A flag could be given to print warnings for anything that wasn't 3.
It didn't have to be perfect, it just had to allow a company to start writing new stuff in 3 only having to modify a few things without having to touch their entire code base. They could then also start incrementally porting things to Python 3 without having to make sure they do everything and their external dependencies at once.
It isn't ideal, but I really, really feel like despite Python's progress over the last decade, it would have been significantly more if all the effort was on Python 3 and all the new features of Python 3 were available to the majority of the Python users. I wonder how many companies switched from Python 2 to golang or similar for features or performance that would have been acceptable in Python 3?
5
May 31 '19
IMO the difficulty of migrating to 3 was just way overblown. They didn't need to create anything like that. They should do what everyone else is doing and give a year to migrate (not 10). Everyone waited to last minute to start the migration.
1
7
u/TBSchemer May 30 '19
2to3.py gave companies a way to easily migrate their code to 3. The ones who didn't really have no excuse at this point.
6
u/gruey May 30 '19
2to3.py is not even close to enough of a solution for significant code bases.
The ones who didn't migrate have pretty valid business reasons for not having done it yet. Basically, what it comes down to, Python's value in companies moving to 3 was greater than most companies value of moving to 3, so Python should have done more work to make it happen.
9
4
u/data-punk May 30 '19
What valid reason spans delay over a decade?
6
u/billsil May 31 '19
It took 10 years for wxpython to officially support 3.x. I moved onto PySide, but not other people.
1
u/nieuweyork since 2007 May 31 '19
I very much agree. A
from __future__ import py3hostingor something, to restore python2.7 semantics for the things that were incompatibly changed. That plusfrom __future__ import print_functionwould have handled a lot of cases.1
u/ALonelyPlatypus Jun 28 '19
wait. companies switched from python2 to go to avoid python3? I mean go is relatively feature rich and overall fun to code but I couldn’t imagine converting your python2 codebase to it when python3 exists.
(unless the company already wanted to move over to a compiled language to address performance concerns)
2
u/billsil May 31 '19
That’s still better. Take what you can get. I upgraded a 2.4 project to 2.7 last year. I just removed hacks and fixed some bugs I created by hacking a 3rd party library to make it work in 2.4.
I just decided to start using 3.7, even if other people continue to use 2.7. I’ll support it if I have to, but I’m going to make sure 3.7 works.
1
0
58
u/hopeinson May 30 '19
Now that you have heard of Python 3, now get ready for Python 4! [/s]
But seriously, we need to start moving on from Py2. It's a dead horse meat now.
17
u/nooobmaster-69 May 30 '19
Python 4 is already mentioned in the timelines for many of the changes. But not to worry, it will be much less of an issue migrating from 3->4 than it was from 2->3.
24
u/Rodot github.com/tardis-sn May 30 '19
That's because Python 4 is just going to be Python 3.10, that's just how they are going to continue with versioning
16
u/flying-sheep May 30 '19
That’s what Guido said a while back, I hope the new guidance council doesn’t share this view and just release 3.10, 3.11, …
→ More replies (2)1
u/billsil May 31 '19
Guido is on the council and was the top vote getter by 30% or so. He was the only council member that got over 50% and cleared that easily. He's quite popular among the core devs.
6
u/flying-sheep May 31 '19
Yes, but I think this is a case he doesn’t feel strongly about but that he still considered his decision / matter of taste when he was BDFL. And such cases will now be voted on, and if the others say “not doing semver is confusing and people will be scared by upgrading to 4.0” there won’t be strong arguments against that.
→ More replies (5)1
u/bageldevourer Jun 01 '19
This isn't necessarily true according to the latest episode of Talk Python.
7
u/tr14l May 30 '19
I have to assume that Py4 will be largely non-breaking. They have to have learned their lesson....right?
10
u/AusIV Django, gevent May 30 '19
If you're following Sem Ver (which I'm not sure if Python claims to do) then you wouldn't go to 4 unless you were breaking something. I'd hope that the version that comes after 3.9 will just be 3.10 if it's backwards compatible. If they go to 4, they will be introducing breaking changes for all the people who use
python3to run their code.→ More replies (1)9
u/twelveshar May 30 '19
Python does not follow SemVer; it allows breaking changes in "minor" versions, like 3.7 -> 3.8. See the development cycle page: https://devguide.python.org/devcycle/
6
-6
May 30 '19
[removed] — view removed comment
24
u/emuccino May 30 '19
"Catastrophe" is a bit dramatic
3
u/alcalde May 30 '19
You'd be surprised. OpenSUSE Linux had a discussion about version numbering a few years ago. They used to go X.0, X.1, X.2, X.3 and then increment by 1 and continue. There was no meaning to the numbers, but it seems casual users didn't know that. Apparently people assumed that a .0 release was a major release and decided to wait for a .1 release to "work out the bugs". Point zero releases were actually showing half the downloads compared to other releases! Not only that, tech sites seemed to think the same way, as reviews of non-point zero releases were lower compared to point zero releases.
They finally decided to drop point zero releases entirely. (They made a lot of other, dumber, numbering ideas later on, like going from 13.4 to 42 and then to 15, but that's another story).
2
u/cyanydeez May 30 '19
numbering in general is just a dumb human thing.
I think we should just give everything flavors and colors
→ More replies (1)0
May 30 '19
[removed] — view removed comment
3
u/zardeh May 30 '19
Yeah but they've had years. Python 3.5 has been out for 4 years. It'll EOL before Py4 comes out. That's enough time to upgrade, especially if the upgrade isn't back-breaking.
1
1
14
May 30 '19
I have been working in 3.x exclusively now for some years, but I recently took out support for 2.x from a couple of old libraries and it was like getting a little stone out of my shoe.
Interestingly 3.4 is now a slight pain point - there are a couple of CI tools like mypy that are only available for Python 3.5 onwards. In new development, I don't support 3.4, but I haven't yet removed it from old libraries that have existing users because why make their lives miserable? 3.4.10, the final version of 3.4, has only recently been released...
15
u/PeridexisErrant May 30 '19
3.4 reached end of life in March, so there are no more security updates for it and many libraries have already dropped support.
1
u/billsil May 31 '19
You sure about mypy? Python 2.7 is supported and you can always run mypy with 3.5. There is no reason other than very minor issues that you couldn’t run mypy. Doesn’t mean other people have to upgrade.
1
May 31 '19
mypy requires 3.5+ checking 2.7 code requires you to specify python interpreter in arguments for the checked version so it knows how to find packages. Perhaps 3.4 could be tested in a similar way, I never did that though.
1
u/edbluetooth May 31 '19
The only reason I run tests for 3.4 is that my customers use Windows XP in many cases.
I agree with 3.5 onwards not supporting XP, but it is a bit of a pain in some situations.
22
u/acerbusbellum May 30 '19
Well unfortunately until the DCC's (Maya, Nuke, Houdini) and our project management system (shotgun) change the interpreters to py3 we'll be such with it.
Has anyone seen much about what Autodesk, Foundry, etc have said about support for py3?
14
u/uberdavis May 30 '19
As I understand, Maya can be run using Python 3. One of my workmates told me there’s a sneaky configuration setting.
1
u/acerbusbellum May 30 '19
Interesting... I'll have to look that up. Do you know what version of Maya your colleague is using?
1
u/uberdavis May 30 '19
I’ll ask and get back to you. I’ve just upgraded myself and would be keen to know.
7
u/JezusTheCarpenter May 30 '19
Eventually all those products will have to switch to Python 3 so I wouldn't worry about it that much. I know they are thinking about it.
4
5
27
u/mrrichardcranium May 30 '19
Just started using python. Learned python 2 because of the systems and frameworks I’m using at work. This last week I started moving all things possible to python 3 in anticipation for it becoming the default on coming OSs. Holy hell does it make a lot of things easier. Basic threading in 3 makes me wish I could rewrite the frameworks my work uses so I could make the full jump over and never look back.
13
u/toyg May 30 '19
Basic threading
You mean asyncio, I guess? It's not really "threading"...
13
u/mrrichardcranium May 30 '19 edited May 30 '19
I mean splitting up a list of 700+ items to 10 workers using threadpoolexecutor. Maybe ‘basic threading’ is not the right description. The fact that it took me two lines to get done is what makes me think of it as basic 😅
7
3
u/TBSchemer May 30 '19
Your workplace definitely needs to hire someone to rewrite those frameworks within the next 6 months.
1
u/mrrichardcranium May 30 '19
If I was a betting man, I would be willing to wage an entire years salary that there are people doing just that. Its a critical automation framework that I don't think we can afford to function without. Though Im sadly not disclosed on the status of that just yet.
32
u/purestrengthsolo May 30 '19
What exactly is "end of life" like programs will no longer work or is it just not receiving any kind of updates?
104
35
u/Losupa May 30 '19
It can mean a variety of things typically it means that there will be very little to no more updates on python 2 libraries, which most importantly means there are no security updates, and thus certain online programs will become unsafe.
60
u/Barafu May 30 '19 edited May 30 '19
It means that very soon after that some security vulnerability will be published, and applications like Calibre or Deluge will become malware hosts if they don't switch to Py3 by then.
Also, they will be kicked out of Linux default repositories.8
u/purestrengthsolo May 30 '19 edited May 30 '19
Thank you and everyone else who replied to me, it helped clarify a little better
→ More replies (3)8
u/Cardeal May 30 '19
Wasn't Calibre
going to bebeing ported? WIP: Port calibre to python 32
u/Dgc2002 May 31 '19
kovidgoyal
Oh god I forgot about that developer. I wish I had the list of links to his shenanigans on hand to provide as context but I don't.
2
u/Cardeal Jun 02 '19
Yeah, I am aware. But I am betting he will port it to python3. He needs the spotlight.
1
u/toyg Jun 03 '19
The guy can be “special” but it’us undeniable that he’s done a lot for the ebook community over the years, and for free.
1
u/_b-e-n_ Jun 21 '19
He's quite annoying, but that software is really good. A fantastic work. That and Alf's tools :-))))
6
u/tr14l May 30 '19
They stop receiving support, so they break slowly over time. Mirrors start becoming more and more seldom found. Then police come to your door and watch you refactor your code.
2
3
u/nukem996 May 30 '19
No updates or support from python.org, this includes security fixes. Some OS vendors(RHEL, Ubuntu, SUSE, etc) will continue to support Python 2.7 in their OS for security fixes until their product goes EOL. A previous job I had refused to put any resources into migrating to Python 3 because they're on RHEL7 which will receive support until 2024 :\
2
u/AlexFromOmaha May 30 '19
Has Red Hat confirmed support for Python 2.7 in userland, instead of just support for the OS's internal security?
2
u/buttery_shame_cave May 30 '19
they're going to finally stop backporting all the good stuff from 3 to 2.
2
May 31 '19
They stopped that in 2015, that's when python 3, that was the hump year for python 3. Could be a coincidence, but I don't believe in those. from 2015-2020 python 2.7 only gets security fixes.
→ More replies (8)1
14
u/NAN001 May 30 '19
You're telling me there is money to be made maintaining a safe version of Python 2.
9
u/kyrsjo May 30 '19
There probably is, however I would expect RedHat etc. will be on it since they anyway need to support RHEL distros which depend on having safe Python2 for quite a few more years.
4
u/james_pic May 30 '19
Yes. Several vendors (RedHat and ActiveState being the best known) are already offering this.
1
9
u/batisteo May 30 '19
Maybe it’s time to update the PEP 394? https://www.python.org/dev/peps/pep-0394/
When Guido is yelling to not use python2 and an official PEP is telling us that python is python2, then it’s hard to not confuse people.
Time to break unmaintained admin scripts guys.
2
24
May 30 '19
To everyone who could not be arsed to look at the Python 2 to 3 update guides for the past however many years: Stop it. Get some help.
8
May 30 '19
I was encouraged to learn 2.7 and stick with it over 3 about 3 years ago and aside from the print statements I can’t really figure out what’s different (I’m not a programmer; I use it for data analysis, image processing in astronomy, and playing around). What are some of the big differences between 2 and 3, in the language of non-CS people?
7
May 30 '19
There are lots and lots of massive changes that occurred from 2 to 3. New libraries, new builtins, syntax changes, more consistent naming, etc. But in my opinion, the biggest change was from eager evaluation to lazy evaluation.
The easiest example is
range. In python 2,rangecreates a list of integers before executing the next line. This potentially slows the runtime down immensely if the number is large enough. Python 3 changes that by only adding to the list when it reaches that point. This removes that upfront cost, and in general speeds up the program.9
u/alcalde May 30 '19
New libraries, new builtins, syntax changes, more consistent naming, etc. But in my opinion, the biggest change was from eager evaluation to lazy evaluation.
Fascinatingly you completely left out the Unicode string change, which is usually cited as the major change. :-)
2
May 31 '19
It was actually THE change that broke python 2 code (actually to be correct most python 2 code is broken, python 2 just didn't complain about it). Basically if you have python 2 code chances are that it will mess up unicode text.
The other incompatible changes were because of it. They thought that since compatibility was broken anyway, why not just use that as an opportunity to cleanup the language.
1
May 30 '19
Would you please explain that?
5
u/billsil May 31 '19
The only painful change about Python 3 is how unicode is handled. The tutorials still suck and nobody tells you even how to figure out what encoding you have. The reality is that user files are in a variety of encodings and they don’t even know what that is.
No other change about python 3 is even worth discussing when planning/worrying about the transition to python 3.
2
u/icegreentea May 31 '19
I think you can add the bytes/str split (which is closely related to the unicode handling). Any code base in python2 that was using str type to represent bytes is in a world of pain converting to python3.
5
u/billsil May 31 '19
That’d be fine. It’s when you’re inconsistent that the pain really sets in. Python 2 did weird ass shit by flipping the encoding multiple times, so you had to encode when you got a decode error and vice verse. Then when you print it, it wouldn’t print correctly even when you had done things right. Python 3 fixed that.
1
u/regeya May 30 '19
Yeah, range() behaves more like xrange() now. Parens in print statements can be annoying after being used to not using them, but it helps with clarity imho.
4
u/TBSchemer May 30 '19
Holy hell, you're using 2.7 for image processing? Whoever "encouraged" you to stick with it should be locked away.
Anything involving big data is far more efficient in 3, because of the switch to lazy evaluation of iterators. Also notably, numpy and everything based on it (pandas, scikit, etc.) have already discontinued support for 2.
3
May 31 '19
Well, the good news is I misremembered, and that particular professor teaching image processing insisted on 3!
5
May 30 '19 edited May 30 '19
You can always use the fork from the guy who made Calibre, whatever that is.
8
u/alcalde May 30 '19
It turns out Calibre is even doing work now to ready it for Python 3, so I think Kovar finally saw the light.
1
May 30 '19 edited May 30 '19
Cool!
But I honestly believe Python 2 will be forked to death and at least one of its variants will be supported for more 20 years (programmers are a stubborn kind :P).
2
u/alcalde May 30 '19
I was shocked myself....
https://github.com/kovidgoyal/calibre/blob/master/README.python3
2
May 30 '19 edited May 31 '19
I find Calibre useful, wonderful and misguided all at the same time. I never wanted an "iTunes for ebooks" (who does?) but I must put up with it in order to convert my files...
2
u/Gorian May 31 '19
I don't want "iTunes for eBooks" but I do want "Plex for eBooks"!
→ More replies (3)1
May 31 '19
I doubt it, python 3 is past the hump and actually python 2 are minority, major packages already stopped supporting 2.
There was also a fork initially called python 2.8, it was renamed since then and it didn't go anywhere.
Edit: https://github.com/naftaliharris/tauthon I was wrong, still exists, so we'll see. As a person who moved to python 3 I don't understand the stubbornness of being on 2.x, a lot of language was cleaned up in 3 and it is much more enjoyable to program in 3.
1
u/toyg Jun 03 '19
I wouldn’t touch Tauthon with a barge pole. Official CPython comes with well-defined governance model, support guarantees, oversight, upgrade paths, security, and so on. Tauthon is literally “a bunch of people on github”. If your business depends on something so critical that you can’t spend a few weeks porting it to 3.6+ and would rather rely on random patches from the internet, you are in trouble.
11
u/whitechapel8733 May 30 '19
My problem with this is that lots of distros are shipping python 2 still.....
65
u/mikew_reddit May 30 '19 edited May 30 '19
Python 3 has been in development over 10 years (since 2008).
It's perfectly fine to cut the cord after a decade.
If CentOS and other distributions can't be bothered to update, that's not really Python's fault.
Edit: original EOL was 2015 according to Guido. Also, Python 2.7 will not get security updates after Jan 1st, 2020.
9
u/whitechapel8733 May 30 '19
I agree, but I’m just saying that’s a serious concern.
31
u/tomanonimos May 30 '19
But a necessary pain. If we keep pushing it for that fear we'll never get rid of Python 2 lol.
2
u/nukem996 May 30 '19
Python.org won't issue security fixes but OS vendors like RHEL/CentOS will continue to patch Python 2.7 themselves.
4
u/alexbuzzbee May 30 '19
I'm pretty sure CentOS is going to Python 3 with RHEL in version 8.
0
u/liquidpele May 30 '19
Which isn’t even close to being released yet. Maaaaybe around December if it takes the same amount of time after rhel7.
5
u/southern_discomfort May 30 '19
RHEL 8 was officially released a few weeks ago. CentOS 8 will not be far behind.
1
u/PooPooDooDoo May 30 '19
It’s fine, we will all have 14 days (during the holidays) to update our code base. Except I am using libraries that are in 2, so I’ll have to wait until they update and then update my code base. So like one day.
-4
u/rasherdk May 30 '19
Python 2.7 will not get security updates after Jan 1st, 2020.
Depends.
1
u/jackmaney May 30 '19
It really doesn't.
4
u/rasherdk May 30 '19 edited May 30 '19
What, yes it does. It (likely) won't get any from PSF. That's not the same as no security updates period.
Edit: Downvoting doesn't make you right. Spreading FUD is not the way to go.
7
u/james_pic May 30 '19
This is true. The version in RedHat will get updates until 2024, and the version in Ubuntu 18.04 will get updates until April 2023.
8
u/w2qw May 30 '19
Shipping or using it as the default? It makes sense that they would still ship it while it's supported.
9
u/Jump3r3 May 30 '19
Using as default,
which pythonyields path to python 2 binary on most distros. That being said, after 1/1/20 this will slowly change for better→ More replies (4)
2
u/ALonelyPlatypus Jun 28 '19
8 years of python experience. a year ago I did the jump to python3. Still struggling with print parens.
3
u/kastoro May 30 '19
Fine, I will do it!
5
u/greeblefritz May 30 '19
The switch isn't as bad as you are probably thinking.
8
u/jjdmol May 30 '19 edited May 30 '19
It isn't bad, but the required effort does scale with the size of your code base. 2to3 only covers some basics, many behavioural differences are more subtle. And python being interpreted you'll discover errors at run time, so will need good test coverage or do a lot of testing.
2
u/PeridexisErrant May 30 '19
Try the
pyupgradeandfuturelibraries - they do a lot more than2to3:-)7
u/james_pic May 30 '19
Futurize did more harm than good when we tried it. It tries to paper over the genuinely different string semantics, and left us with something broken that we understood even less than what we started with.
Modernize is more conservative, and in our experience, gives a better starting point. If you've got a big codebase, you've still got an uphill battle ahead of you.
Also, use mypy type hints. In general, I hate them, but they're really helpful for clarifying type usage in legacy codebases.
1
u/PeridexisErrant May 30 '19
Hmm, thanks for the tip! I've use
futurize --stage1a fair bit but never really liked the second stage... though just getting syntax-compatible with Python 3 allows many more tools to work.I'll try modernize :-)
1
u/kastoro May 30 '19
Thanks, that is encouraging. Is what I thought, I just never found the time to do it, you know, always behind schedule
5
u/stefantalpalaru May 30 '19
What is dead may never die, but rises again harder and stronger: https://github.com/naftaliharris/tauthon/
10
u/NoahTheDuke May 30 '19
Ew. Why would someone spend that much effort on a broken version of Python?
→ More replies (5)
2
u/sphildreth May 30 '19
I was surprised to learn that CentOS 7 still uses Python 2.7 as its default.
2
u/omento SysAdmin Film/VFX - 3.7 May 30 '19
RHEL 7 came out in 2014 and had its version freeze in 2013, when Python 3.3 was a thing. This is well before Python 3 support really took off. The point of RHEL is to provide 10 years of rock solid platform support, so critical system level packages (like GLIBC, gcc, and python) do NOT change versions or break ABI at all in the products lifespan. Some of the OS level tools, like yum, are written primarily in Python so making an upgrade would break that.
RHEL 8 provides a new solution for this by providing a ‘hidden’ python version for dependent OS tools, while allowing the user to install the python version of their choice from the appstream modules. Currently 2.7 and 3.6 are available for use. Red Hat also rewrote a lot of tooling to not use python, or reduce the dependency on it to further help with this.
1
May 30 '19
~ $ sudo apt purge python2.7-minimal --auto-remove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libpython2.7-minimal* nodejs* python-minimal* python2-minimal*
python2.7-minimal*
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
After this operation, 78.8 MB disk space will be freed.
Do you want to continue? [Y/n] 1
u/yeluapyeroc May 30 '19
My number one velocity killer right now, but I'm glad its finally happening
1
1
1
1
1
May 30 '19
I don't understand why it takes so long. For ages python 2 comes with tools that help you to migrate to python 3 smoothly. Python code isn't even that hard to port in most cases. It's it because of C libraries?
6
u/alcalde May 30 '19
It's because of users.
In the Delphi langauge's move to Unicode they introduced "ANSI strings" (8bit non-Unicode strings) as a tool to allow users to compile their old code in the new version and gradually port over to Unicode.
What happened? Many users continued to write all of their new code using ANSI Strings and kept right on going like nothing ever happened. Then when there was talk years later of rewriting the compiler and consequently dropping ANSI strings, these users screamed "Wait! We haven't had any time to convert!"
It got so bad these people managed to get ANSI strings added to the new Delphi Android and iOS compilers, which had never had non-Unicode strings in the first place! :-(
The same kind of thing happened to Python 2. When I had asked the then-maintainer of Pyjamas (??? - one of the Python to Javascript transpilers anyway) about porting to Python 3, he answered "Python 2 is going to be supported forever, so why bother?"
We've got a user here who continues to insist that the PSF will still move the support deadline for Python 2; maybe they're the same person.
0
May 30 '19
[deleted]
4
u/fireflash38 May 30 '19 edited May 30 '19
That doesn't even get into supporting varied OSes & distros, even old ones (we get stuff for: HPUX, AIX, Solaris, SunOS, etc). Shit, we still get some support requests for WS2008. We have to have a 'quarantine' lab for a lot of the OSes we support because corp doesn't want them on their network (understandably).
Most of the time when I see people lambasting others using python2 they are in a small company or startup, or a company that is heavily web-focused. You can usually tell by how much they talk about unicode (instead of bytestring) :) If you're at all doing low-level system stuff, the conversion can be quite painful as you've said.
0
u/alcalde May 30 '19
It's not a nightmare because everyone else has already done it.
https://medium.com/@boxed/moving-a-large-and-old-codebase-to-python3-33a5a13f8c99
0
May 30 '19
[deleted]
1
u/alcalde May 30 '19
Instagram said it went smoothly....
https://thenewstack.io/instagram-makes-smooth-move-python-3/
1
1
u/Sin-Silver May 30 '19
So I’ve been studying Python for two weeks now following ‘Learn Python the hard way’ which recommends python 2.7 over 3. What does this mean for me?
3
u/Mr_Again May 31 '19
The author has, or had, a weird grudge against py3. Just ignore it and learn Python 3. It's almost 100% the same when you're starting out, except for print, xrange, and anything involving unicode.
1
u/Sin-Silver Jun 01 '19
Would it be worth learning python 3 later then if there little or no difference?
I don’t want to get stuck on a problem it’s trying to each because of a difference between 2.7 and 3 that’s not transparent.
1
u/Mr_Again Jun 01 '19
Honestly no, if it's an issue just learn the python 3 way of doing things, you'll probably never use python 2, it's dead now.
1
u/Sin-Silver Jun 01 '19
So how hard would it to take what I’ve learnt from Python 2.7 and transfer it to 3?
I’m looking at changing courses, but I’ve sunk alot of time into it, and don’t want to unless necessary.
1
4
u/mountainunicycler May 30 '19
You should switch to 3, but it won’t make a ton of difference at your point so you might be able to keep using the same tutorials with the exception of the print statement.
1
u/Sin-Silver Jun 01 '19
Would it be worth learning python 3 later then if there little or no difference?
I don’t want to get stuck on a problem it’s trying to each because of a difference between 2.7 and 3 that’s not transparent.
2
u/mountainunicycler Jun 01 '19
Many of the changes between python 2 and python 3 make it easier to learn; python3 is more consistent and easier to understand—and at this point there’s no benefit to learning the quirks of python 2 because they’ve been fixed.
I’d definitely recommend switching to a python 3 course.
1
u/Sin-Silver Jun 01 '19
I’ll have a hunt around. any recommendations on books?
2
u/mountainunicycler Jun 01 '19
I’m not sure about books; I just learned by making things and looking up how to do it when I got stuck (so basically searching stack overflow for each line when I was starting).
In my opinion you learn a lot faster when you have a goal in mind if something to build.
1
u/alcalde May 30 '19 edited May 30 '19
Where's /u/nieuweyork? They were insisting that the PSF will definitely extend the support deadline for Python 2 again or else it would be catastrophic for Python... "Actually stopping security patches for 2.7 runs the risk that someone starts funneling funds to a new organisation that will keep patching a 2.7 compatible version. This would be...not good for the Python Foundation."
-1
u/nieuweyork since 2007 May 30 '19
Yeah I'll believe it when the deadline hits. This has been "definitely going to happen" more than once in the past.
5
u/alcalde May 30 '19
It's almost June 1 and Guido himself is still saying it's going to happen. Do you think it's going to change December 31, or....?
This has been "definitely going to happen" more than once in the past.
But the conditions of the past are not the current conditions. If a doctor once says he believes you're going to die and you survive, you're not rendered functionally immortal as a result.
As I've told you before, every major library from Pandas to Django is running on Python 3 now and many, including major web and scientific computing stack libraries, have already ended support for Python 2. That was certainly not the case when the deadline was extended in the past. In short, there's no need to extend the deadline again. What conditions do you see continuing to exist that would render a last-minute reprieve necessary?
0
u/nieuweyork since 2007 May 30 '19
Well, significant usage of 2.7 continuing through to the present.
4
u/flying-sheep May 31 '19
Significant, but not enough. Companies that didn’t switch now will never switch if the deadline would be pushed out for them. They’re the kind of companies that only starts thinking about buying fire extinguishers when 33% of the premises have burnt down and the fire has started to lick at the CEO’s rolls royce.
3
0
0
u/Skyfoot May 30 '19
RemindMe! 1st Dec 2019 "Hand in your notice"
0
u/RemindMeBot May 30 '19
I will be messaging you on 2019-12-01 17:23:27 UTC to remind you of this link.
CLICK THIS LINK to send a PM to also be reminded and to reduce spam.
Parent commenter can delete this message to hide from others.
FAQs Custom Your Reminders Feedback Code Browser Extensions
0
0
May 30 '19
Learner here, does this mean I should uninstall any/all version of python2 on my laptop along with libraries??? (I'm already using python 3.6 for all my projects, just wondering if I should keep python2)
13
u/hachihoshino May 30 '19
If it's a version of python 2 you installed yourself, then yeah, sure. However, if it's a version of python 2 that came installed with the system, it's best not to touch it - your OS is probably using that for some internal stuff and you don't know what you might break if you try to remove it.
4
u/liquidpele May 30 '19
But DO install python3 alongside the system python and use 3 for everything!
0
u/JezusTheCarpenter May 30 '19
Any specific quide how to deal with the transition of the the Python C API as apparently this will be different in Python3? Mayb it will be a good opportunity to switch to PyBind11.
-26
May 30 '19
You can't really End of Life open source software like python. GPL compatible means irrevocability of copy-lefts. Business and end users who still use python 2 will support it without resources from the PSF. Large projects that never left python2 will switch to that repository/code base.
An entire desktop environment was created around gnome 2's deprecation. Python 2.7 is going to live on forever, a monument to poor project management decisions regarding backwards compatibility.
23
u/aEverr May 30 '19
EOL in this case just means loss of support from the official (?), so anyone can update it, but don't rely on it
2
u/port53 relative noob May 30 '19
Red Hat will support py2 for a few more years. With those patches then going to centos, that's all people will need to keep using it.
1
u/kyrsjo May 30 '19
That's great for the Linux users who are already on RHEL, or can switch distro easily...
→ More replies (7)1
u/cediddi SyntaxError: not a chance May 30 '19
Some corporation may provide paid support for a custom python distro (Anaconda?) and that's okay. Psf may as well, but not the official repo. That's it. I can still install python 1.6 and it works and until some years ago, some companies supported their embedded py 1.6 setups.
4
May 30 '19
Python 2.7 is going to live on forever, a monument to poor project management decisions regarding backwards compatibility.
Probably true, but probably uninteresting to most of us, since we won't see them.
1
277
u/billsil May 30 '19
I killed my libraries support for python 2 last Friday. It feels good to get rid of six, future, scans it, and pathlib2 and really start doing type annotations properly.
People are already trying to get me to change my mind. But my company uses Anaconda...use a virtual environment; Anaconda lets you have multiple versions of python. It’s coming like a train and all my dependencies have moved on. Time for me to as well.