![](https://csdnimg.cn/release/download_crawler_static/88728198/bg14.jpg)
master (and to implement efficiently and without bugs) than a simpler one. Com‐
plications and quirks in a language hamper productivity in software development,
particularly in large projects, where many developers cooperate and, often, maintain
code originally written by others.
Python is fairly simple, but not simplistic. It adheres to the idea that, if a language
behaves a certain way in some contexts, it should ideally work similarly in all
contexts. Python follows the principle that a language should not have “convenient”
shortcuts, special cases, ad hoc exceptions, overly subtle distinctions, or mysterious
and tricky under-the-covers optimizations. A good language, like any other well-
designed artifact, must balance general principles with taste, common sense, and a
lot of practicality.
Python is a general-purpose programming language: its traits are useful in almost
any area of software development. There is no area where Python cannot be part
of a solution. “Part” is important here; while many developers find that Python fills
all of their needs, it does not have to stand alone. Python programs can cooperate
with a variety of other software components, making it the right language for gluing
together components in other languages. A design goal of the language is, and has
long been, to “play well with others.”
Python is a very high-level language (VHLL). This means that it uses a higher
level of abstraction, conceptually further away from the underlying machine, than
classic compiled languages such as C, C++, and Rust, traditionally called “high-level
languages.” Python is simpler, faster to process (both for humans and for tools),
and more regular than classic high-level languages. This affords high programmer
productivity, making Python a strong development tool. Good compilers for classic
compiled languages can generate binary code that runs faster than Python. In most
cases, however, the performance of Python-coded applications is sufficient. When it
isn’t, apply the optimization techniques covered in “Optimization” on page 541 to
improve your program’s performance while keeping the benefit of high productivity.
In terms of language level, Python is comparable to other powerful VHLLs like
JavaScript, Ruby, and Perl. The advantages of simplicity and regularity, however,
remain on Python’s side.
Python is an object-oriented programming language, but it lets you program in
both object-oriented and procedural styles, with a touch of functional programming
too, mixing and matching as your application requires. Python’s object-oriented
features are conceptually similar to those of C++ but simpler to use.
The Python Standard Library and Extension Modules
There is more to Python programming than just the language: the standard library
and other extension modules are almost as important for Python use as the lan‐
guage itself. The Python standard library supplies many well-designed, solid Python
modules for convenient reuse. It includes modules for such tasks as representing
data, processing text, interacting with the operating system and filesystem, and web
programming, and works on all platforms supported by Python.
2 | Chapter 1: Introduction to Python