Вы находитесь на странице: 1из 6

Python (programming language)

From Wikipedia, the free encyclopedia

Jump to navigation
Jump to search
Python

Paradigm Multi-paradigm: functional,


imperative, object-oriented,
structured, reflective
Designed by Guido van Rossum
Developer Python Software Foundation
First appeared 1990; 30 years ago[1]

Stable release 3.8.5 / 20 July 2020;


2 months ago[2]
Preview 3.9.0rc1 / 11 August 2020;
release 40 days ago[3]
Typing Duck, dynamic, gradual
discipline (since 3.5)[4]
OS Linux, macOS, Windows
Vista (and newer) and more
License Python Software Foundation
License
Filename .py, .pyi, .pyc, .pyd, .pyo
extensions (prior to 3.5),[5] .pyw, .pyz
(since 3.5)[6]
Website www.python.org
Major implementations
CPython, PyPy, Stackless Python,
MicroPython, CircuitPython, IronPython,
Jython, RustPython
Dialects
Cython, RPython, Starlark[7]
Influenced by
ABC,[8] Ada,[9] ALGOL 68,[10] APL,[11] C,[12] C++,
[13] CLU,[14] Dylan,[15] Haskell,[16] Icon,[17] Java,[18]

Lisp,[19] Modula-3,[13] Perl, Standard ML[11]


Influenced
Apache Groovy, Boo, Cobra, CoffeeScript,[20]
D, F#, Genie,[21] Go, JavaScript,[22][23] Julia,[24]
Nim, Ring,[25] Ruby,[26] Swift[27]

• Python Programming at Wikibooks


Python is an interpreted, high-level and general-purpose programming language.
Created by Guido van Rossum and first released in 1991, Python's design philosophy
emphasizes code readability with its notable use of significant whitespace. Its
language constructs and object-oriented approach aim to help programmers write
clear, logical code for small and large-scale projects.[28]
Python is dynamically typed and garbage-collected. It supports multiple
programming paradigms, including structured (particularly, procedural), object-
oriented, and functional programming. Python is often described as a "batteries
included" language due to its comprehensive standard library.[29]
Python was created in the late 1980s as a successor to the ABC language. Python 2.0,
released in 2000, introduced features like list comprehensions and a garbage
collection system with reference counting.
Python 3.0, released in 2008, was a major revision of the language that is not
completely backward-compatible, and much Python 2 code does not run unmodified
on Python 3.
The Python 2 language was officially discontinued in 2020 (first planned for 2015),
and "Python 2.7.18 is the last Python 2.7 release and therefore the last Python 2
release."[30] No more security patches or other improvements will be released for it.[31]
[32] With Python 2's end-of-life, only Python 3.5.x[33] and later are supported.

Python interpreters are available for many operating systems. A global community of
programmers develops and maintains CPython, a free and open-source[34] reference
implementation. A non-profit organization, the Python Software Foundation, manages
and directs resources for Python and CPython development.

Contents
1 C
r
o L
P A
U s a
y P
S D R n s n
t I
F t e e s - g
h O d
e a v f u c u
S o t o
a t e e p o a
y n h c
t e l I r p m g
n p e u F
u m o m e o p e
t E r r D m u
r I e M p p n rt il P s R
a x o i e e rt
e n n a L m l c e e e i e
H x p M g m v n S S h
s d t T t i e e e d r rf N n f
i a r e r p e t e o e
a e s y h b n m i i s o a U fl e
s n e t a l l a e u r
n n a p e r t e m m t r m s u r
t 2 3d 3.13.23.3
s 3.4
h 3.53.64m 5 6 7 7.17.2
e 7.37.47.58o 9ti 10 11 12 13
a 14 14.1
r 15
r 16
d t n i m a e n p p o m i e e e
o s s o m m p o l c e
p a d n a ri n t l l o a n s n n
r e i d i e m n s e a
h ti c g ti e v a e e t n g c c
y m o s n n e g o s d
il o o c s ir ti m m h c e e
a n g t n e i
o n n s o o e e e e d s
n s e a t n n
s tr n n n n r b
ti x ti e g
o o m s t t l y
c a o r
p l e a a a P
s m n a
h fl n ti ti n y
p s t
y o t o o g t
l o
w s n n u h
e r
s a o
s s
g n
e
s
External linksHistory[edit]
Guido van Rossum at OSCON 2006
Main article: History of Python
Python was conceived in the late 1980s[35] by Guido van Rossum at Centrum
Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC
language (itself inspired by SETL),[36] capable of exception handling and interfacing
with the Amoeba operating system.[8] Its implementation began in December 1989.[37]
Van Rossum shouldered sole responsibility for the project, as the lead developer, until
12 July 2018, when he announced his "permanent vacation" from his responsibilities
as Python's Benevolent Dictator For Life, a title the Python community bestowed
upon him to reflect his long-term commitment as the project's chief decision-maker.
[38] He now shares his leadership as a member of a five-person steering council.[39][40][41]

In January 2019, active Python core developers elected Brett Cannon, Nick Coghlan,
Barry Warsaw, Carol Willing and Van Rossum to a five-member "Steering Council"
to lead the project.[42]
Python 2.0 was released on 16 October 2000 with many major new features,
including a cycle-detecting garbage collector and support for Unicode.[43]
Python 3.0 was released on 3 December 2008. It was a major revision of the language
that is not completely backward-compatible.[44] Many of its major features were
backported to Python 2.6.x[45] and 2.7.x version series. Releases of Python 3 include
the 2to3 utility, which automates (at least partially) the translation of Python 2 code to
Python 3.[46]
Python 2.7's end-of-life date was initially set at 2015 then postponed to 2020 out of
concern that a large body of existing code could not easily be forward-ported to
Python 3.[47][48]
Features and philosophy[edit]
Python is a multi-paradigm programming language. Object-oriented programming
and structured programming are fully supported, and many of its features support
functional programming and aspect-oriented programming (including by
metaprogramming[49] and metaobjects (magic methods)).[50] Many other paradigms are
supported via extensions, including design by contract[51][52] and logic programming.[53]
Python uses dynamic typing and a combination of reference counting and a cycle-
detecting garbage collector for memory management.[54] It also features dynamic
name resolution (late binding), which binds method and variable names during
program execution.
Python's design offers some support for functional programming in the Lisp tradition.
It has filter, map, and reduce functions; list comprehensions, dictionaries, sets, and
generator expressions.[55] The standard library has two modules (itertools and
functools) that implement functional tools borrowed from Haskell and Standard ML.
[56]

The language's core philosophy is summarized in the document The Zen of Python
(PEP 20), which includes aphorisms such as:[57]
• Beautiful is better than ugly.
• Explicit is better than implicit.
• Simple is better than complex.
• Complex is better than complicated.
• Readability counts.
Rather than having all of its functionality built into its core, Python was designed to
be highly extensible. This compact modularity has made it particularly popular as a
means of adding programmable interfaces to existing applications. Van Rossum's
vision of a small core language with a large standard library and easily extensible
interpreter stemmed from his frustrations with ABC, which espoused the opposite
approach.[35]
Python strives for a simpler, less-cluttered syntax and grammar while giving
developers a choice in their coding methodology. In contrast to Perl's "there is more
than one way to do it" motto, Python embraces a "there should be one—and
preferably only one—obvious way to do it" design philosophy.[57] Alex Martelli, a
Fellow at the Python Software Foundation and Python book author, writes that "To
describe something as 'clever' is not considered a compliment in the Python
culture."[58]
Python's developers strive to avoid premature optimization, and reject patches to non-
critical parts of the CPython reference implementation that would offer marginal
increases in speed at the cost of clarity.[59] When speed is important, a Python
programmer can move time-critical functions to extension modules written in
languages such as C, or use PyPy, a just-in-time compiler. Cython is also available,
which translates a Python script into C and makes direct C-level API calls into the
Python interpreter.
An important goal of Python's developers is keeping it fun to use. This is reflected in
the language's name—a tribute to the British comedy group Monty Python[60]—and in
occasionally playful approaches to tutorials and reference materials, such as examples
that refer to spam and eggs (from a famous Monty Python sketch) instead of the
standard foo and bar.[61][62]
A common neologism in the Python community is pythonic, which can have a wide
range of meanings related to program style. To say that code is pythonic is to say that
it uses Python idioms well, that it is natural or shows fluency in the language, that it
conforms with Python's minimalist philosophy and emphasis on readability. In
contrast, code that is difficult to understand or reads like a rough transcription from
another programming language is called unpythonic.
Users and admirers of Python, especially those considered knowledgeable or
experienced, are often referred to as Pythonistas.[63][64]

Вам также может понравиться