I am missing the point why Python3 has commands are not compatible with Python2.
Because Python 3 is not the same language as Python 2.
Python releases normally are mostly backwards compatible with previous versions; Python 2.7 is largely backwards compatible with Python 2.6.
However, from the start, Python 3 (or 3000 as its design project originally codenamed) was specifically different. Quoting from one of the design documents:
Python 3000 will introduce a number of backwards-incompatible changes to Python, mainly to streamline the language and to remove some previous design mistakes.)
So, Python 3 is not backwards compatible to correct specific errors in the language that could not be corrected with backwards compatible changes.
The use of a statement to write to stdout
instead of a function is one of those changes; print
has been replaced by a function print()
.
Different language and software projects use different standards for what their version numbers mean. Python sticks to the major-minor-micro scheme; releases within the same major number are largely backwards compatible, releases within the same minor number only contain bug fixes. See the Python version number FAQ:
Python versions are numbered A.B.C
or A.B
. A
is the major version number – it is only incremented for really major changes in the language. B
is the minor version number, incremented for less earth-shattering changes. C
is the micro-level – it is incremented for each bugfix release. See PEP 6 for more information about bugfix releases.
Python is also quite a bit older than C#. Python development started in 1989, and version 2.0 came out in 2000. C# on the other hand has only been around since 2002; perhaps in another decade or so it too will see a backwards-incompatible change.