W. H. Heydt
Posts: 12955
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Python 2 EoL...at least in theory

Wed Apr 22, 2020 4:24 am

https://www.theregister.co.uk/2020/04/2 ... 2_release/

Some companies are--apparently--planning to keep it going, though.

User avatar
Imperf3kt
Posts: 3748
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Python 2 EoL...at least in theory

Wed Apr 22, 2020 6:40 am

I recall this being discussed some months ago.
55:55:44:44:4C
52:4C:52:42:41

Heater
Posts: 16296
Joined: Tue Jul 17, 2012 3:02 pm

Re: Python 2 EoL...at least in theory

Wed Apr 22, 2020 8:45 am

Great. One down, one to go. Then we will be free of Python :)

The end of Python 2 has been intensely discussed since the introduction of the new language Python 3, 12 years ago!
Last edited by Heater on Wed Apr 22, 2020 11:28 pm, edited 1 time in total.
Memory in C++ is a leaky abstraction .

jahboater
Posts: 5927
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Python 2 EoL...at least in theory

Wed Apr 22, 2020 9:00 am

It will never go away while typing "python" in most distro's still gets you Python2
Pi4 8GB running PIOS64 Lite

User avatar
Imperf3kt
Posts: 3748
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Python 2 EoL...at least in theory

Wed Apr 22, 2020 10:31 pm

Imperf3kt wrote:
Wed Apr 22, 2020 6:40 am
I recall this being discussed some months ago.
My memory isn't failing me, for once...
viewtopic.php?f=32&t=249393&p=1528073#p1522670
55:55:44:44:4C
52:4C:52:42:41

drgeoff
Posts: 10924
Joined: Wed Jan 25, 2012 6:39 pm

Re: Python 2 EoL...at least in theory

Wed Apr 22, 2020 11:46 pm

Theory and practice are not always the same.
Quis custodiet ipsos custodes?

W. H. Heydt
Posts: 12955
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Python 2 EoL...at least in theory

Thu Apr 23, 2020 12:37 am

drgeoff wrote:
Wed Apr 22, 2020 11:46 pm
Theory and practice are not always the same.
In theory...they are. In practice...they aren't. (I wish I lived in Theory...everything *works* in Theory.)

User avatar
davidcoton
Posts: 5131
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Python 2 EoL...at least in theory

Thu Apr 23, 2020 10:45 am

W. H. Heydt wrote:
Thu Apr 23, 2020 12:37 am
(I wish I lived in Theory...everything *works* in Theory.)
Does Theory account for the behaviour of gyroscopes yet?

Or the missing mass of the universe? Dark Matter Identified :!:
Location: 345th cell on the right of the 210th row of L2 cache

Heater
Posts: 16296
Joined: Tue Jul 17, 2012 3:02 pm

Re: Python 2 EoL...at least in theory

Thu Apr 23, 2020 11:32 am

Ah, I get it, the dark matter is made of gyroscopes.

That is why stars are orbiting their galaxies at the wrong speed.
Memory in C++ is a leaky abstraction .

User avatar
bensimmo
Posts: 4712
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Python 2 EoL...at least in theory

Thu Apr 23, 2020 12:45 pm

jahboater wrote:
Wed Apr 22, 2020 9:00 am
It will never go away while typing "python" in most distro's still gets you Python2
I think the latest Ubuntu has it removed and debian based setups will have at the next major update.

All good, but given they've had years and years to move it over, why did it take so long. not to worry

anyway, it will come eventually.
Last edited by bensimmo on Thu Apr 23, 2020 12:57 pm, edited 1 time in total.

jahboater
Posts: 5927
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Python 2 EoL...at least in theory

Thu Apr 23, 2020 12:50 pm

Good!

for now:

alias python=python3

does the job, or use the shebang line
Pi4 8GB running PIOS64 Lite

Heater
Posts: 16296
Joined: Tue Jul 17, 2012 3:02 pm

Re: Python 2 EoL...at least in theory

Thu Apr 23, 2020 1:41 pm

Given that they created an incompatible, syntactically different, language that was not backwards compatible I think they should have given their new language a different name.

"Brian" for example.

That would have saved a lot of confusion and wasted human life over the years. And we could have all happily continued with Python and ignored Brian.
Memory in C++ is a leaky abstraction .

GlowInTheDark
Posts: 839
Joined: Sat Nov 09, 2019 12:14 pm

Re: Python 2 EoL...at least in theory

Thu Apr 23, 2020 1:55 pm

It is my understanding that there is one particular piece of software that is widely used (many if not most of the participants on this board have probably used it; I use it several times a day) that is Python2 based and is so huge that converting it over would be unfeasable (sp?).

As long as that piece of software is in use (which is to say, forever), Python2 cannot completely go away.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

User avatar
Paeryn
Posts: 3008
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Python 2 EoL...at least in theory

Thu Apr 23, 2020 2:42 pm

Heater wrote:
Thu Apr 23, 2020 1:41 pm
Given that they created an incompatible, syntactically different, language that was not backwards compatible I think they should have given their new language a different name.

"Brian" for example.

That would have saved a lot of confusion and wasted human life over the years. And we could have all happily continued with Python and ignored Brian.
Poor Brian, was he just a very naughty boy for messing with python?

They did give the updated python a new name, python3, a total rename just because of a few language changes would be ridiculous. I don't remember there being long-running complaints back when python2 started replacing python, people just fixed their code to account for the breakages (probably fewer than from 2->3 but they were there) and got on with using the newer version to the point that python2 effectively became python and no-one uses the original python anymore (I can't remember if 1.0 broke 0.9, I was new to it back then).
She who travels light — forgot something.

Heater
Posts: 16296
Joined: Tue Jul 17, 2012 3:02 pm

Re: Python 2 EoL...at least in theory

Fri Apr 24, 2020 12:58 am

Paeryn wrote:
Thu Apr 23, 2020 2:42 pm
...They did give the updated python a new name, python3,
I don't buy the idea of "Python3" being a new name. It's clearly meant to indicate a version change in Python.
Paeryn wrote:
Thu Apr 23, 2020 2:42 pm
...a total rename just because of a few language changes would be ridiculous....
Would it? How much a change in a languages syntax and semantics would you require to say "that is a different language". There is a reason "C++" is not "C".

As it stands Python 2 programs do not run under Python 3. That smells like a different language. Not only the the changes are not so trivial and some are impossible find easily without looking at all your code carefully. This cannot be automated. They may be no errors from the run time.
Paeryn wrote:
Thu Apr 23, 2020 2:42 pm
I don't remember there being long-running complaints back when python2 started replacing python, people just fixed their code to account for the breakages (probably fewer than from 2->3 but they were there) and got on with using the newer version to the point that python2 effectively became python and no-one uses the original python anymore (I can't remember if 1.0 broke 0.9, I was new to it back then).
That was a long time ago. There were far less Python users around. There was far less Python code in existence. There was far less Python as a dependency of other things. It was a happier time.
Memory in C++ is a leaky abstraction .

User avatar
Imperf3kt
Posts: 3748
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Python 2 EoL...at least in theory

Fri Apr 24, 2020 1:15 am

I recall trying to use python 2 code in a python 3 script... It did work, but it didn't do the same thing as it did in python2

Skills you learn with python2, may not work the same, or at all in python 3, and vice versa
55:55:44:44:4C
52:4C:52:42:41

User avatar
ehem
Posts: 55
Joined: Mon Sep 09, 2019 1:17 am

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 2:57 am

Heater wrote:
Fri Apr 24, 2020 12:58 am
As it stands Python 2 programs do not run under Python 3. That smells like a different language. Not only the the changes are not so trivial and some are impossible find easily without looking at all your code carefully. This cannot be automated. They may be no errors from the run time.
They can almost certainly be automated. Worst case, write a Python 2 interpreter in Python 3 and you should be able to continue running Python 2 within Python 3. I haven't done anything very gnarly with Python, but 2 and 3 are mostly fairly compatible.

At the most basic level, Python 3 shares rather a lot of Python 2's characteristics. I ran across a presentation of someone talking about all the features they would include to make the most annoying programming language possible. Syntactically significant whitespace was near the top of the presenter's list.

One tab to rule them all. If you like 4 space indentations, set your tab stop to 4 spaces. Heck, even covers the person who likes 5 space indentations.

W. H. Heydt
Posts: 12955
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 4:10 am

ehem wrote:
Fri May 22, 2020 2:57 am
One tab to rule them all. If you like 4 space indentations, set your tab stop to 4 spaces. Heck, even covers the person who likes 5 space indentations.
You're too young to have done much of anything with languages that were originally written with unit records intended...like FORTRAN II or COBOL. Or SPS II, Autocoder, or ALC. Or--shudder--RPG.

gkreidl
Posts: 6346
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 5:42 am

ehem wrote:
Fri May 22, 2020 2:57 am
Heater wrote:
Fri Apr 24, 2020 12:58 am
As it stands Python 2 programs do not run under Python 3. That smells like a different language. Not only the the changes are not so trivial and some are impossible find easily without looking at all your code carefully. This cannot be automated. They may be no errors from the run time.
They can almost certainly be automated. Worst case, write a Python 2 interpreter in Python 3 and you should be able to continue running Python 2 within Python 3. I haven't done anything very gnarly with Python, but 2 and 3 are mostly fairly compatible.
...
No, Heater's right. Although there are some tools for conversion, you will have a lot of bugs/problems. Here's a simple example:

Let's assume "d" is a dictionary.

Code: Select all

k = d.keys()
k.sort()
will run in Python and produce a sorted list of keys.
In Python3 it will produce an error, because the keys() function now returns an iterator and not a list any more.
No kind of conversion tool will fix this.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

jahboater
Posts: 5927
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 8:06 am

Here is another example - a basic math operator has changed its semantics.
... and this time it wont produce an error, just silently return the wrong answer!

Code: Select all

 $ python
Python 2.7.12 (default, Apr 15 2020, 17:07:12) 
>>> 2/3
0
>>> 
$ python3
Python 3.7.2 (default, Jan  9 2019, 15:51:37) 
>>> 2/3
0.6666666666666666
>>> 
Pi4 8GB running PIOS64 Lite

Heater
Posts: 16296
Joined: Tue Jul 17, 2012 3:02 pm

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 8:11 am

ehem wrote:
Fri May 22, 2020 2:57 am
They can almost certainly be automated.
I do wish people would not speak so stridently on matters they know nothing about. This is why the internet is full of incorrect junk.

If you do your research you will find that automating conversion of the Python 2 language to the Python 3 language is hard to impossible. see gkreidl 's example above for starters.

If such a conversion were possible the tools(s) to do it would have been created a decade ago. They could have been part of a Python 3 installation. This whole 2 vs 3 problem would have been resolved ages ago.
ehem wrote:
Fri May 22, 2020 2:57 am
Worst case, write a Python 2 interpreter in Python 3 and you should be able to continue running Python 2 within Python 3. I haven't done anything very gnarly with Python, but 2 and 3 are mostly fairly compatible.
Interpreting Python 2 from within Python 3 is hardly going to be a practically working solution.
ehem wrote:
Fri May 22, 2020 2:57 am
At the most basic level, Python 3 shares rather a lot of Python 2's characteristics.
Sure it does. Problem is it's impossible to tell which is which from reading the source so conversion is hard.
ehem wrote:
Fri May 22, 2020 2:57 am
I ran across a presentation of someone talking about all the features they would include to make the most annoying programming language possible. Syntactically significant whitespace was near the top of the presenter's list.

One tab to rule them all. If you like 4 space indentations, set your tab stop to 4 spaces. Heck, even covers the person who likes 5 space indentations.
It's not the TAB width that is the problem. Although of course nobody should use TAB characters in their code. The whole idea of using white space as block delimiting is daft. And, if you are going to do it so as to remove weird braces and such then do a proper job and don't require that stupid redundant ":" everywhere.

I big issue is that it is that with the lack of a type system and other high level language features that help ensure correct code it is so hard to tell if your python programs work correctly in the first place that nobody wants to touch them simply to change language to Python 3.

Yes Python 3 is a different language. It has a different syntax and semantics than Python 2, that is what makes languages different, and is not backwards compatible. See above.
Memory in C++ is a leaky abstraction .

scotty101
Posts: 4004
Joined: Fri Jun 08, 2012 6:03 pm

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 8:18 am

Boo hoo. Heater thinks python sucks.

Change the record.. python's popularity speaks for itself.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
DougieLawson
Posts: 39551
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 8:22 am

W. H. Heydt wrote:
Fri May 22, 2020 4:10 am
ehem wrote:
Fri May 22, 2020 2:57 am
One tab to rule them all. If you like 4 space indentations, set your tab stop to 4 spaces. Heck, even covers the person who likes 5 space indentations.
You're too young to have done much of anything with languages that were originally written with unit records intended...like FORTRAN II or COBOL. Or SPS II, Autocoder, or ALC. Or--shudder--RPG.
You're showing your age. I've not heard or used the term "unit record device" (for card readers, card punches and line printers) in more than 30 years.

BTW, I thought python2 had a happy death on 1st Jan 2020.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Heater
Posts: 16296
Joined: Tue Jul 17, 2012 3:02 pm

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 8:44 am

scotty101 wrote:
Fri May 22, 2020 8:18 am
Boo hoo. Heater thinks python sucks.

Change the record.. python's popularity speaks for itself.
If you ever find you have been around the block a few times and have had to program in more languages than you care to remember you will likely come to the conclusion that all programming languages suck.

We know this to be generally true because new programming languages sprout like weeds. Why would so many talented software engineers, waste their time trying to define and build new programming languages if they were happy with anything that existed already?

Since when has popularity been a measure of the quality of anything?

Also note that for most things people do with Python they are actually depending on libraries written in other languages. From driving GPIO to OpenCV to Tensorflow etc, etc, etc.
Memory in C++ is a leaky abstraction .

jahboater
Posts: 5927
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Python 2 EoL...at least in theory

Fri May 22, 2020 9:10 am

Heater wrote:
Fri May 22, 2020 8:44 am
Since when has popularity been a measure of the quality of anything?
Of course, rarely.
But it is a measure of the practical usability of the language for real world applications.
In this case universal availability, vast library resources, extensive knowledge base, etc etc.
Wide exposure means less bugs.
Pi4 8GB running PIOS64 Lite

Return to “Off topic discussion”