How many versions do I need? !!!


29 posts   Page 2 of 2   1, 2
by gkreidl » Sat Apr 29, 2017 5:06 am
kusti8 wrote:The point is that python 2 and 3 is more like C and C++, although with less drastic changes. Python3 was an effort to try and fix all the mistakes that were in Python2 and make it less quirky and more functional. Could they have made it backwards compatible? Sure. But that is a ton more work and also makes that their buggy Python2 version will forever be around. It was a big overhaul. I don't really see what the problem is though. I program in Python3, not Python2 and if there is some library that isn't in 3 I just move on. It also helps that Arch linux has python symlinked to Python3 not Python2 like most systems.

Nothing to do with "mistakes" and "quirks" but simply a question of language design. After developing it for a number of years they came to the point where they thought, that some things should have been done differently form the beginning. But breaking compatibility is always a hard decision, especially for a programming language. So now we have two, Python 2 and Python 3.

I think the oldest Python code I have (not my own), has been written for 1.3 and still runs without changes with Python 2.7.9. There are millions of Python programs out there, which have been working for many years and so there is no reason to change anything.
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
Posts: 5121
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany
by gkreidl » Sat Apr 29, 2017 5:11 am
Martin Frezman wrote:
The already do. It's called 2to3. Or you could also use six.


OK - good to know.

The next step, then, is, of course, to build that functionality into the Python 3 interpreter, so that it can run either kind of script. Problem solved. On to the next.

Sorry, but this is complete nonsense. The meaning of some basic data types has changed (str, unicode, byte). You cannot mix that in any kind of "compatibility" mode. It would be a nightmare.
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
Posts: 5121
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany
by pd2 » Wed May 17, 2017 11:07 am
TideMan wrote:Whereas Fortran IV code from the 1960s will work fine with the latest gfortran compiler.

Ahhhh! Fortran the first language that I learnt at Uni, I think running on a PDP11.
Ohhhh! Dropping those punched Hollerith cards on the stairwell.

Thanks for the informative replies on Python. Can't say that I like the language much though. Documentation and examples are of variable quality and also mixed between versions which is often not clear. Still I suppose it is easier to program than 6502/Z80 Assembler...
Posts: 26
Joined: Sun Jun 05, 2016 11:42 am
by jamesh » Wed May 17, 2017 11:20 am
pd2 wrote:
TideMan wrote:Whereas Fortran IV code from the 1960s will work fine with the latest gfortran compiler.

Ahhhh! Fortran the first language that I learnt at Uni, I think running on a PDP11.
Ohhhh! Dropping those punched Hollerith cards on the stairwell.

Thanks for the informative replies on Python. Can't say that I like the language much though. Documentation and examples are of variable quality and also mixed between versions which is often not clear. Still I suppose it is easier to program than 6502/Z80 Assembler...


6502/Z80 are pretty easy....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17403
Joined: Sat Jul 30, 2011 7:41 pm