I have learned that Python 3 is not backwards compatible.
Will it not affect a lot of applications using older versions of Python?
How did the developers of Python 3 not think it was absolutely necessary to make it backwards compatible?
The Python language does not provide backward compatibility.
Python version 3 is not backwardly compatible with Python 2. Many recent developers are creating libraries which you can only use with Python 3. Many older libraries created for Python 2 is not forward-compatible.
Just open the python files in the pycharm editor, it will show warnings if the code is not compatible to Python2 or Python3.
Python 3.0 implements a lot of very useful features and breaks backward compatibility. It does it on purpose, so the great features can be implemented even despite the fact Python 2.x code may not work correctly under Python 3.x.
So, basically, Python 3.0 is not backward-compatible on purpose. Thanks to that, you can benefit from a whole new set of features. It is even called "Python 3000" or "Python 3K".
From "What's new in Python 3.0" (available here):
Python 3.0, compared to 2.6. Python 3.0, also known as “Python 3000” or “Py3K”, is the first ever intentionally backwards incompatible Python release. There are more changes than in a typical release, and more that are important for all Python users. Nevertheless, after digesting the changes, you’ll find that Python really hasn’t changed all that much – by and large, we’re mostly fixing well-known annoyances and warts, and removing a lot of old cruft.
Some of the most notable features that may be considered as breaking backward compatibility, but improving the language at the same time, are:
print
is now a function, not a statement, and using it as statement will result in an error,cmp
argument for sorting functions like sorted()
and list.sort()
is no longer supported, and should be replaced by key
argument,int
is now the same as Python 2.x's long
, which makes number processing less complex,/
operator is now an operator for true division by default (you can still use //
for floor division),True
, False
and None
are now reserved words (so you are not able to do True, False = False, True
,BaseException
, must be raised & caught differently than in Python 2.x,If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With