Let's summarize the course and talk about Python in general. In this lesson, you'll learn the history of this language and some important nuances about the different versions. This knowledge will help you choose modern solutions and write safe code.
How Python came to be
In the late eighties, the Dutch programmer Guido van Rossum worked at the Centrum Wiskunde & Informatica, where he created the ABC programming language. Guido put everything he had into this project and learned from it.
In December 1989, the office closed for the Christmas vacation, and Guido had nothing to do. So he wrote an interpreter for his new programming language for fun. He named his non-serious project "Python" after his favorite comedy show, Monty Python's Flying Circus.
How Python evolved
As early as 1991, the first version of Python, 0.9.0, was released. The new language incorporates many ideas from ABC and other languages. For example, the module system is from Modula-3.
A little later, version 1.0 came out. It has elements of functional programming, such as the functions map
, filter
, and reduce
. We will study them in future courses.
Version 2.0 introduced the famous list of inclusives borrowed from SETL and Haskell. That's when the garbage collector appeared. It is a mechanism for automatic memory management. That release also added support for working with loop structures.
We will not dive into this topic in the basics course but discuss it in detail in other Python courses.
Python has been constantly evolving from its beginnings to the present day. Now, almost everyone uses the third version.
How to use Python as a tool
Python emphasizes code readability and concise syntax, positioning itself as a language for everyone. This philosophy makes the language more understandable and desirable to newcomers.
However, we should discuss some aspects of working with Python in more detail.
Avoid legacy libraries
The first release of version 3 of Python came out back in 2008, but the transition to it is still ongoing.
The point is that the third version isn't fully backward-compatible with the second version. To switch to version 3, you can't just replace the interpreter; you should change the code. Developers take this step if the project is still under development.
But some programs are finished: they're in a support-only state. We call them legacy programs. Such projects often don't go to version 3. There is usually just nobody to do the adaptation.
If the program becomes a legacy project, no new difficulties will arise. The situation with libraries is more complicated. Some basic libraries still rely on version 2. There's no one to update them, and there's nothing to replace them yet.
It is why the transition to version 3 of Python took so long.
Moreover, as of 2020, version 2 is no longer supported — the developers stopped fixing vulnerabilities and critical bugs. Obsolete libraries can now be a threat to entire projects.
Fortunately, most popular libraries have already switched to version 3. Moreover, all modern libraries should rely on Python 3.7.x.
Check the Python version in your OS
Python isn't just a common language for writing final projects. This language often helps to automate various tasks. For example, Ansible, a system administration software, is written in it. Because of this, in most cases, Python is pre-installed on operating systems.
It's especially likely to be found in Linux operating systems. In addition, a version of Linux might run on a server you use for your web application or multiplayer game.
Here is the problem: your operating system may have Python version 2 installed. It is something that still happens. And it won't be possible to replace it because doing so could cause your entire OS to fail.
Don't worry! You can fix this problem. In the environment setup course, you'll learn how to use the appropriate version of Python in your project.