Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Python (programming language)

From Wikipedia, the free encyclopedia
This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages)
This article needs to beupdated. The reason given is: Information related to stable Python version 3.14.0 is not present. Please help update this article to reflect recent events or newly available information.(October 2025)
This articlemay containunverified orindiscriminate information inembedded lists. Please helpclean up the lists by removing items or incorporating them into the text of the article.(October 2025)
(Learn how and when to remove this message)
General-purpose programming language

Python
ParadigmMulti-paradigm:object-oriented,[1]procedural (imperative),functional,structured,reflective
Designed byGuido van Rossum
DeveloperPython Software Foundation
First appeared20 February 1991; 34 years ago (1991-02-20)[2]
Stable release
3.14.0[3] Edit this on Wikidata / 7 October 2025; 49 days ago (7 October 2025)
Typing disciplineDuck,dynamic,strong;[4]optional type annotations[a]
Memory managementGarbage-collected
OSCross-platform including 32-bitWindows 10 and e.g. for mobile;Android andiOS(both 64-bit)[b]
LicensePython Software Foundation License
Filename extensions.py, .pyw, .pyz,[10]
.pyi, .pyc, .pyd
Websitepython.org
Majorimplementations
CPython,PyPy,MicroPython,CircuitPython,IronPython,Jython,Stackless Python
Dialects
Cython,RPython,Starlark[11]
Influenced by
ABC,[12]Ada,[13][failed verification]ALGOL 68,[14]APL,[15]C,[16]C++,[17]CLU,[18]Dylan,[19]Haskell,[20][15]Icon,[21]Lisp,[22]Modula-3,[14][17]Perl,[23]Standard ML[15]
Influenced
Apache Groovy,Boo,Cobra,CoffeeScript,[24]D,F#,GDScript,Go,JavaScript,[25][26]Julia,[27]Mojo,[28]Nim,Ring,[29]Ruby,[30]Swift,[31]V[32]
This article is part ofa series on
Python
Python logo

Python is ahigh-level,general-purpose programming language. Its design philosophy emphasizescode readability with the use ofsignificant indentation.[33] Python isdynamically type-checked andgarbage-collected. It supports multipleprogramming paradigms, includingstructured (particularlyprocedural),object-oriented andfunctional programming.

Guido van Rossum began working on Python in the late 1980s as a successor to theABC programming language. Python 3.0, released in 2008, was a major revision and not completelybackward-compatible with earlier versions. Beginning with Python 3.5,[34] capabilities and keywords for typing were added to the language, allowing optionalstatic typing.[35] Currently only versions in the 3.x series are supported.

Python has gained widespread use in themachine learning community.[36][37][38][39] It is widely taught as an introductory programming language.[40] Since 2003, Python has consistently ranked in the top ten of the most popular programming languages in theTIOBE Programming Community Index, which ranks based on searches in 24 platforms.[41]

History

[edit]
Main article:History of Python
The designer of Python,Guido van Rossum, atPyCon US 2024

Python was conceived in the late 1980s[42] byGuido van Rossum atCentrum Wiskunde & Informatica (CWI) in theNetherlands.[43] It was designed as a successor to theABC programming language, which was inspired bySETL,[44] capable ofexception handling and interfacing with theAmoeba operating system.[12] Python implementation began in December 1989.[43] Van Rossum first released it in 1991 as Python 0.9.0.[43] Van Rossum assumed sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his "permanent vacation" from responsibilities as Python's "benevolent dictator for life" (BDFL); this title was bestowed on him by the Python community to reflect his long-term commitment as the project's chief decision-maker.[45] (He has since come out of retirement and is self-titled "BDFL-emeritus".) In January 2019, active Python core developers elected a five-member Steering Council to lead the project.[46][47]

The namePython derives from the British comedy seriesMonty Python's Flying Circus.[48] (See§ Naming.)

Python 2.0 was released on 16 October 2000, featuring many new features such aslist comprehensions,cycle-detecting garbage collection,reference counting, andUnicode support.[49] Python 2.7'send-of-life was initially set for 2015, and then postponed to 2020 out of concern that a large body of existing code could not easily be forward-ported to Python 3.[50][51] It no longer receives security patches or updates.[52][53] While Python 2.7 and older versions are officially unsupported, a different unofficial Python implementation,PyPy, continues to support Python 2, i.e., "2.7.18+" (plus 3.11), with the plus signifying (at least some) "backported security updates".[54]

Python 3.0 was released on 3 December 2008, and was a major revision and not completelybackward-compatible with earlier versions, with some new semantics and changed syntax. Python 2.7.18, released in 2020, was the last release of Python 2.[55] Several releases in the Python 3.x series have added new syntax to the language, and made a few (considered very minor) backward-incompatible changes.

As of November 2025[update], Python 3.14.0 is the latest stable release, and Python 3.13.9 was released a week later, all older 3.x versions had a security update down to Python 3.9.24 then again with 3.9.25, the final version in 3.9 series. Python 3.10 is, since November 2025, the oldest supported branch.[56] Python 3.15 has an alpha released, and Android has a official downloadable executable available for Python 3.14. Releases receive two years of full support followed by three years of security support.

Design philosophy and features

[edit]

Python is amulti-paradigm programming language. Object-oriented programming and structured programming are fully supported, and many of their features support functional programming andaspect-oriented programming – includingmetaprogramming[57] andmetaobjects.[58] Many other paradigms are supported via extensions, includingdesign by contract[59][60] andlogic programming.[61] Python is often referred to as a'glue language'[62] because it is purposely designed to be able to integrate components written in other languages.

Python uses dynamic typing and a combination ofreference counting and a cycle-detecting garbage collector formemory management.[63] It uses dynamicname 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 hasfilter,map, andreduce functions;list comprehensions,dictionaries,sets, andgenerator expressions.[64] The standard library has two modules (itertools andfunctools) that implement functional tools borrowed fromHaskell andStandard ML.[65]

Python's core philosophy is summarized in theZen of Python (PEP 20) written byTim Peters, which includes aphorisms such as these:[66]

  • Explicit is better than implicit.
  • Simple is better than complex.
  • Readability counts.
  • Special cases aren't special enough to break the rules.
  • Although practicality beats purity.
  • Errors should never pass silently.
  • Unless explicitly silenced.
  • There should be one-- and preferably only one --obvious way to do it.

However, Python has received criticism for violating these principles and adding unnecessary language bloat.[67] Responses to these criticisms note that the Zen of Python is a guideline rather than a rule.[68] The addition of some new features had been controversial: Guido van Rossum resigned asBenevolent Dictator for Life after conflict about adding the assignment expression operator inPython 3.8 .[69][70]

Nevertheless, rather than building all functionality into its core, Python was designed to be highlyextensible via modules. 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 represented the opposite approach.[42]

Python claims to strive for a simpler, less-cluttered syntax and grammar, while giving developers a choice in their coding methodology. Python lacks do while loops, whichRossum considered harmful.[71] In contrast toPerl's motto "there is more than one way to do it", Python advocates an approach where "there should be one – and preferably only one – obvious way to do it".[66] In practice, however, Python provides many ways to achieve a given goal. There are at least three ways to format a string literal, with no certainty as to which one a programmer should use.[72]Alex Martelli is aFellow at thePython Software Foundation and Python book author; he wrote that "To describe something as 'clever' isnot considered a compliment in the Python culture."[73]

Python's developers typically prioritise readability over performance. For example, they reject patches to non-critical parts of theCPython reference implementation that would offer increases in speed that do not justify the cost of clarity and readability.[74][failed verification] Execution speed can be improved by moving speed-critical functions to extension modules written in languages such asC, or by using ajust-in-time compiler likePyPy. Also, it is possible to transpile to other languages. However, this approach either fails to achieve the expected speed-up, since Python is a verydynamic language, or only a restricted subset of Python is compiled (with potential minor semantic changes).[75]

Python is meant to be a fun language to use. This goal is reflected in the name – a tribute to the British comedy groupMonty Python[76] – and in playful approaches to some tutorials and reference materials. For instance, some code examples use the terms "spam" and "eggs" (in reference toa Monty Python sketch), rather than the typical terms"foo" and "bar".[77][78]

A commonneologism in the Python community ispythonic, which has a broad range of meanings related to program style: Pythonic code may use Pythonidioms well; be natural or show fluency in the language; or conform with Python's minimalist philosophy and emphasis on readability.[79]

Syntax and semantics

[edit]
Main article:Python syntax and semantics

Python is meant to be an easily readable language. Its formatting is visually uncluttered and often uses English keywords where other languages use punctuation. Unlike many other languages, it does not usecurly brackets to delimit blocks, and semicolons after statements are allowed but rarely used. It has fewer syntactic exceptions and special cases thanC orPascal.[80]

Indentation

[edit]
Further information:Python syntax and semantics § Indentation

Python useswhitespace indentation, rather than curly brackets or keywords, to delimitblocks. An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.[81] Thus, the program's visual structure accurately represents its semantic structure.[82] This feature is sometimes termed theoff-side rule. Some other languages use indentation this way; but in most, indentation has no semantic meaning. The recommended indent size is four spaces.[83]

Statements and control flow

[edit]

Python'sstatements include the following:

  • Theassignment statement, using a single equals sign=
  • Theif statement, which conditionally executes a block of code, along withelse andelif (a contraction ofelse if)
  • Thefor statement, which iterates over aniterable object, capturing each element to a variable for use by the attached block; the variable is not deleted when the loop finishes
  • Thewhile statement, which executes a block of code as long as boolean condition is true
  • Thetry statement, which allows exceptions raised in its attached code block to be caught and handled byexcept clauses (or new syntaxexcept* in Python 3.11 for exception groups);[84] thetry statement also ensures that clean-up code in afinally block is always run regardless of how the block exits
  • Theraise statement, used to raise a specified exception or re-raise a caught exception
  • Theclass statement, which executes a block of code and attaches its local namespace to aclass, for use in object-oriented programming
  • Thedef statement, which defines afunction ormethod
  • Thewith statement, which encloses a code block within a context manager, allowingresource-acquisition-is-initialization (RAII)-like behavior and replacing a common try/finally idiom[85] Examples of a context include acquiring alock before some code is run, and then releasing the lock; or opening and then closing afile
  • Thebreak statement, which exits a loop
  • Thecontinue statement, which skips the rest of the current iteration and continues with the next
  • Thedel statement, which removes a variable—deleting the reference from the name to the value, and producing an error if the variable is referred to before it is redefined[c]
  • Thepass statement, serving as aNOP (i.e., no operation), which is syntactically needed to create an empty code block
  • Theassert statement, used in debugging to check for conditions that should apply
  • Theyield statement, which returns a value from agenerator function (and also an operator); used to implementcoroutines
  • Thereturn statement, used to return a value from a function
  • Theimport andfrom statements, used to import modules whose functions or variables can be used in the current program
  • Thematch andcase statements, analogous to aswitch statement construct, which compares an expression against one or more cases as a control-flow measure

The assignment statement (=) binds a name as areference to a separate, dynamically allocatedobject. Variables may subsequently be rebound at any time to any object. In Python, a variable name is a generic reference holder without a fixeddata type; however, it always refers tosome object with a type. This is calleddynamic typing—in contrast tostatically-typed languages, where each variable may contain only a value of a certain type.

Python does not supporttail call optimization orfirst-class continuations; according to Van Rossum, the language never will.[86][87] However, better support forcoroutine-like functionality is provided by extending Python's generators.[88] Before 2.5, generators werelazyiterators; data was passed unidirectionally out of the generator. From Python 2.5 on, it is possible to pass data back into a generator function; and from version 3.3, data can be passed through multiple stack levels.[89]

Expressions

[edit]

Python'sexpressions include the following:

  • The+,-, and* operators for mathematical addition, subtraction, and multiplication are similar to other languages, but the behavior of division differs. There are two types of division in Python:floor division (or integer division)//, and floating-point division/.[90] Python uses the** operator for exponentiation.
  • Python uses the+ operator for string concatenation. The language uses the* operator for duplicating a string a specified number of times.
  • The@ infix operator is intended to be used by libraries such asNumPy formatrix multiplication.[91][92]
  • The syntax:=, called the "walrus operator", was introduced in Python 3.8. This operator assigns values to variables as part of a larger expression.[93]
  • In Python,== compares two objects by value. Python'sis operator may be used to compare object identities (i.e., comparison by reference), and comparisons may be chained—for example,a<=b<=c.
  • Python usesand,or, andnot as Boolean operators.
  • Python has a type of expression called alist comprehension, and a more general expression called agenerator expression.[64]
  • Anonymous functions are implemented usinglambda expressions; however, there may be only one expression in each body.
  • Conditional expressions are written asxifcelsey.[94] (This is different in operand order from thec ? x : y operator common to many other languages.)
  • Python makes a distinction betweenlists andtuples. Lists are written as[1,2,3], are mutable, and cannot be used as the keys of dictionaries (since dictionary keys must beimmutable in Python). Tuples, written as(1,2,3), are immutable and thus can be used as the keys of dictionaries, provided that all of the tuple's elements are immutable. The+ operator can be used to concatenate two tuples, which does not directly modify their contents, but produces a new tuple containing the elements of both. For example, given the variablet initially equal to(1,2,3), executingt=t+(4,5) first evaluatest+(4,5), which yields(1,2,3,4,5); this result is then assigned back tot—thereby effectively "modifying the contents" oft while conforming to the immutable nature of tuple objects. Parentheses are optional for tuples in unambiguous contexts.[95]
  • Python featuressequence unpacking where multiple expressions, each evaluating to something assignable (e.g., a variable or a writable property) are associated just as in forming tuple literal; as a whole, the results are then put on the left-hand side of the equal sign in an assignment statement. This statement expects aniterable object on the right-hand side of the equal sign to produce the same number of values as the writable expressions on the left-hand side; while iterating, the statement assigns each of the values produced on the right to the corresponding expression on the left.[96]
  • Python has a "string format" operator% that functions analogously toprintf format strings in the C language—e.g."spam=%s eggs=%d"%("blah",2) evaluates to"spam=blah eggs=2". In Python 2.6+ and 3+, this operator was supplemented by theformat() method of thestr class, e.g.,"spam={0} eggs={1}".format("blah",2). Python 3.6 added "f-strings":spam="blah";eggs=2;f'spam={spam} eggs={eggs}'.[97]
  • Strings in Python can beconcatenated by "adding" them (using the same operator as for adding integers and floats); e.g.,"spam"+"eggs" returns"spameggs". If strings contain numbers, they are concatenated as strings rather than as integers, e.g."2"+"2" returns"22".
  • Python supportsstring literals in several ways:
    • Delimited by single or double quotation marks; single and double quotation marks have equivalent functionality (unlike inUnix shells,Perl, and Perl-influenced languages). Both marks use the backslash (\) as anescape character.String interpolation became available in Python 3.6 as "formatted string literals".[97]
    • Triple-quoted, i.e., starting and ending with three single or double quotation marks; this may span multiple lines and function likehere documents in shells, Perl, andRuby.
    • Raw string varieties, denoted by prefixing the string literal withr. Escape sequences are not interpreted; hence raw strings are useful where literal backslashes are common, such as inregular expressions andWindows-style paths. (Compare "@-quoting" inC#.)
  • Python hasarray index andarray slicing expressions in lists, which are written asa[key],a[start:stop] ora[start:stop:step]. Indexes arezero-based, and negative indexes are relative to the end. Slices take elements from thestart index up to, but not including, thestop index. The (optional) third sliceparameter, calledstep orstride, allows elements to be skipped or reversed. Slice indexes may be omitted—for example,a[:] returns a copy of the entire list. Each element of a slice is ashallow copy.

In Python, a distinction between expressions and statements is rigidly enforced, in contrast to languages such asCommon Lisp,Scheme, orRuby. This distinction leads to duplicating some functionality, for example:

  • List comprehensions vs.for-loops
  • Conditional expressions vs.if blocks
  • Theeval() vs.exec() built-in functions (in Python 2,exec is a statement); the former function is for expressions, while the latter is for statements

A statement cannot be part of an expression; because of this restriction, expressions such as list anddict comprehensions (and lambda expressions) cannot contain statements. As a particular case, an assignment statement such asa=1 cannot be part of the conditional expression of a conditional statement.

Typing

[edit]
The standard type hierarchy in Python 3

Python usesduck typing, and it has typed objects but untyped variable names. Type constraints are not checked at definition time; rather, operations on an object may fail at usage time, indicating that the object is not of an appropriate type. Despite beingdynamically typed, Python isstrongly typed, forbidding operations that are poorly defined (e.g., adding a number and a string) rather than quietly attempting to interpret them.

Python allows programmers to define their own types usingclasses, most often forobject-oriented programming. Newinstances of classes are constructed by calling the class, for example,SpamClass() orEggsClass()); the classes are instances of themetaclasstype (which is an instance of itself), thereby allowing metaprogramming andreflection.

Before version 3.0, Python had two kinds of classes, both using the same syntax:old-style andnew-style.[98] Current Python versions support the semantics of only the new style.

Python supportsoptional type annotations.[5][99] These annotations are not enforced by the language, but may be used by external tools such asmypy to catch errors. Python includes a moduletyping including several type names for type annotations.[100][101] Also, Mypy supports a Python compiler called mypyc, which leverages type annotations for optimization.[102]

Summary of Python 3's built-in types
TypeMutabilityDescriptionSyntax examples
boolimmutableBoolean valueTrue
False
bytearraymutableSequence ofbytesbytearray(b'Some ASCII')
bytearray(b"Some ASCII")
bytearray([119,105,107,105])
bytesimmutableSequence of bytesb'Some ASCII'
b"Some ASCII"
bytes([119,105,107,105])
compleximmutableComplex number with real and imaginary parts3+2.7j
3+2.7j
5j
dictmutableAssociative array (or dictionary) of key and value pairs; can contain mixed types (keys and values); keys must be a hashable type{'key1':1.0,3:False}
{}
types.EllipsisTypeimmutableAnellipsis placeholder to be used as an index inNumPy arrays...
Ellipsis
floatimmutableDouble-precisionfloating-point number. The precision is machine-dependent, but in practice it is generally implemented as a 64-bitIEEE 754 number with 53 bits of precision.[103]

1.33333

frozensetimmutableUnorderedset, contains no duplicates; can contain mixed types, if hashablefrozenset({4.0,'string',True})

frozenset()

intimmutableInteger of unlimited magnitude[104]42
listmutableList, can contain mixed types[4.0,'string',True]
[]
types.NoneTypeimmutableAn object representing the absence of a value, often callednull in other languagesNone
types.NotImplementedTypeimmutableA placeholder that can be returned fromoverloaded operators to indicate unsupported operand types.NotImplemented
rangeimmutableAnimmutable sequence of numbers, commonly used for iterating a specific number of times infor loops[105]range(1,10)
range(10,5,2)
setmutableUnorderedset, contains no duplicates; can contain mixed types, if hashable{4.0,'string',True}
set()
strimmutableAcharacter string: sequence of Unicode codepoints'Wikipedia'
"Wikipedia"
"""Spanningmultiplelines"""
tupleimmutableTuple, can contain mixed types(4.0,'string',True)
('single element',)
()

Arithmetic operations

[edit]

Python includes conventional symbols for arithmetic operators (+,-,*,/), the floor-division operator//, and themodulo operator%. (With the modulo operator, a remainder can be negative, e.g.,4 % -3 == -2.) Also, Python offers the** symbol forexponentiation, e.g.5**3 == 125 and9**0.5 == 3.0. Also, it offers the matrix‑multiplication operator@ .[106] These operators work as in traditional mathematics; with the sameprecedence rules, theinfix operators+ and- can also beunary, to represent positive and negative numbers respectively.

Division between integers produces floating-point results. The behavior of division has changed significantly over time:[107]

  • The current version of Python (i.e., since 3.0) changed the/ operator to always represent floating-point division, e.g.,5/2==2.5.
  • The floor division// operator was introduced, meaning that7//3 == 2,-7//3 == -3,7.5//3 == 2.0, and-7.5//3 == -3.0. For Python 2.7, adding thefrom__future__importdivision statement allows a module in Python 2.7 to use Python 3.x rules for division (see above).

In Python terms, the/ operator representstrue division (or simplydivision), while the// operator representsfloor division. Before version 3.0, the/ operator representsclassic division.[107]

Rounding towards negative infinity, though a different method than in most languages, adds consistency to Python. For instance, this rounding implies that the equation(a+b)//b==a//b+1 is always true. Also, the rounding implies that the equationb*(a//b)+a%b==a is valid for both positive and negative values ofa. As expected, the result ofa%b lies in thehalf-open interval [0,b), whereb is a positive integer; however, maintaining the validity of the equation requires that the result must lie in the interval (b, 0] whenb is negative.[108]

Python provides around function for rounding a float to the nearest integer. Fortie-breaking, Python 3 uses theround to even method:round(1.5) andround(2.5) both produce2.[109] Python versions before 3 used theround-away-from-zero method:round(0.5) is1.0, andround(-0.5) is−1.0.[110]

Python allows Boolean expressions that contain multiple equality relations to be consistent with general usage in mathematics. For example, the expressiona < b < c tests whethera is less thanb andb is less thanc.[111] C-derived languages interpret this expression differently: in C, the expression would first evaluatea < b, resulting in 0 or 1, and that result would then be compared withc.[112]

Python usesarbitrary-precision arithmetic for all integer operations. TheDecimal type/class in thedecimal module providesdecimal floating-point numbers to a pre-defined arbitrary precision with several rounding modes.[113] TheFraction class in thefractions module provides arbitrary precision forrational numbers.[114]

Due to Python's extensive mathematics library and the third-party libraryNumPy, the language is frequently used for scientific scripting in tasks such as numerical data processing and manipulation.[115][116]

Function syntax

[edit]

Functions are created in Python by using thedef keyword. A function is defined similarly to how it is called, by first providing the function name and then the required parameters. Here is an example of a function that prints its inputs:

defprinter(input1,input2="already there"):print(input1)print(input2)printer("hello")# Example output:# hello# already there

To assign a default value to a function parameter in case no actual value is provided at run time, variable-definition syntax can be used inside the function header.

Code examples

[edit]

"Hello, World!" program:

print('Hello, World!')

Program to calculate thefactorial of a non-negative integer:

text=input('Type a number, and its factorial will be printed: ')n=int(text)ifn<0:raiseValueError('You must enter a non-negative integer')factorial=1foriinrange(2,n+1):factorial*=iprint(factorial)

Libraries

[edit]

Python's large standard library[117] is commonly cited as one of its greatest strengths. For Internet-facing applications, many standard formats and protocols such asMIME andHTTP are supported. The language includes modules for creatinggraphical user interfaces, connecting torelational databases,generating pseudorandom numbers, arithmetic with arbitrary-precision decimals,[113] manipulatingregular expressions, andunit testing.

Some parts of the standard library are covered by specifications—for example, theWeb Server Gateway Interface (WSGI) implementationwsgiref follows PEP 333[118]—but most parts are specified by their code, internal documentation, andtest suites. However, because most of the standard library is cross-platform Python code, only a few modules must be altered or rewritten for variant implementations.

As of 13 March 2025,[update] thePython Package Index (PyPI), the official repository for third-party Python software, contains over 614,339[119] packages.

Development environments

[edit]
See also:Comparison of integrated development environments § Python

Most[which?] Python implementations (including CPython) include aread–eval–print loop (REPL); this permits the environment to function as acommand line interpreter, with which users enter statements sequentially and receive results immediately.[120]

Also, CPython is bundled with anintegrated development environment (IDE) calledIDLE,[121] which is oriented toward beginners.[citation needed]

Other shells, includingIDLE andIPython, add additional capabilities such as improved auto-completion, session-state retention, andsyntax highlighting.[121][122]

Standard desktop IDEs includePyCharm,Spyder, andVisual Studio Code;[citation needed] there areweb browser-based IDEs, such as the following environments:

Implementations

[edit]
See also:List of Python software § Python implementations

Reference implementation

[edit]

CPython is thereference implementation of Python. This implementation is written in C, meeting theC11 standard[126] since version 3.11. Older versions use theC89 standard with several selectC99 features, but third-party extensions are not limited to older C versions—e.g., they can be implemented using C11 or C++.[127][128] CPythoncompiles Python programs into an intermediatebytecode,[129] which is then executed by avirtual machine.[130] CPython is distributed with a large standard library written in a combination of C and native Python.

CPython is available for many platforms, including Windows and most modernUnix-like systems, including macOS (andApple M1 Macs, since Python 3.9.1, using an experimental installer). Starting with Python 3.9, the Python installer intentionally fails to install onWindows 7 and 8;[131][132]Windows XP was supported until Python 3.5, with unofficial support forVMS.[133] Platform portability was one of Python's earliest priorities.[134] During development of Python 1 and 2, evenOS/2 andSolaris were supported;[7] since that time, support has been dropped for many platforms.

All current Python versions (since 3.7) support only operating systems that feature multithreading, by now supporting not nearly as many operating systems (dropping many outdated) than in the past.

Limitations of the reference implementation

[edit]
  • The energy usage of Python with CPython for typically written code is much worse than C by a factor of 75.88.[135]
  • The throughput of Python with CPython for typically written code is worse than C by a factor of 71.9.[135]
  • The average memory usage of CPython for typically written code is worse than C by a factor of 2.4.[135]

Other implementations

[edit]

All alternative implementations have at least slightly different semantics. For example, an alternative may include unordered dictionaries, in contrast to other current Python versions. As another example in the larger Python ecosystem, PyPy does not support the full C Python API.

Creating an executable with Python often is done by bundling an entire Python interpreter into the executable, which causes binary sizes to be massive for small programs,[136] yet there exist implementations that are capable of truly compiling Python. Alternative implementations include the following:

  • PyPy is a faster, compliant interpreter of Python 2.7 and 3.10.[137][138] PyPy'sjust-in-time compiler often improves speed significantly relative to CPython, but PyPy does not support some libraries written in C.[139] PyPy offers support for theRISC-V instruction-set architecture.
  • Codon is an implementation with anahead-of-time (AOT) compiler, which compiles a statically-typed Python-like language whose "syntax and semantics are nearly identical to Python's, there are some notable differences"[140] For example, Codon uses 64-bit machine integers for speed, not arbitrarily as with Python; Codon developers claim that speedups over CPython are usually on the order of ten to a hundred times. Codon compiles to machine code (viaLLVM) and supports native multithreading.[141] Codon can also compile to Python extension modules that can be imported and used from Python.
  • MicroPython andCircuitPython are Python 3 variants that are optimized formicrocontrollers, including theLego Mindstorms EV3.[142]
  • Pyston is a variant of the Python runtime that uses just-in-time compilation to speed up execution of Python programs.[143]
  • Cinder is a performance-oriented fork of CPython 3.8 that features a number of optimizations, including bytecode inline caching, eager evaluation of coroutines, a method-at-a-timeJIT, and an experimental bytecode compiler.[144]
  • The Snek[145][146][147] embedded computing language "is Python-inspired, but it is not Python. It is possible to write Snek programs that run under a full Python system, but most Python programs will not run under Snek."[148] Snek is compatible with 8-bitAVR microcontrollers such asATmega 328P-based Arduino, as well as larger microcontrollers that are compatible withMicroPython. Snek is an imperative language that (unlike Python) omitsobject-oriented programming. Snek supports only one numeric data type, which features 32-bitsingle precision (resemblingJavaScript numbers, though smaller).

Unsupported implementations

[edit]

Stackless Python is a significant fork of CPython that implementsmicrothreads. This implementation uses thecall stack differently, thus allowing massively concurrent programs. PyPy also offers a stackless version.[149]

Just-in-time Python compilers have been developed, but are now unsupported:

  • Google began a project namedUnladen Swallow in 2009: this project aimed to speed up the Python interpreter five-fold by usingLLVM, and improvemultithreading capability for scaling to thousands of cores,[150] while typical implementations are limited by theglobal interpreter lock.
  • Psyco is a discontinuedjust-in-timespecializing compiler, which integrates with CPython and transforms bytecode to machine code at runtime. The emitted code is specialized for certaindata types and is faster than standard Python code. Psyco does not support Python 2.7 or later.
  • PyS60 was a Python 2 interpreter forSeries 60 mobile phones, which was released byNokia in 2005. The interpreter implemented many modules from Python's standard library, as well as additional modules for integration with theSymbian operating system. The NokiaN900 also supports Python through theGTK widget library, allowing programs to be written and run on the target device.[151]

Transpilers to other languages

[edit]

There are several compilers/transpilers to high-level object languages; the source language is unrestricted Python, a subset of Python, or a language similar to Python:

  • Brython[152] and Transcrypt[153][154] compile Python toJavaScript.
  • Cython compiles a superset of Python to C. The resulting code can be used with Python via direct C-level API calls into the Python interpreter.
  • PyJL compiles/transpiles a subset of Python to "human-readable, maintainable, and high-performance Julia source code".[75] Despite the developers' performance claims, this is not possible forarbitrary Python code; that is, compiling to a faster language or machine code is known to be impossible in the general case. The semantics of Python might potentially be changed, but in many cases speedup is possible with few or no changes in the Python code. The faster Julia source code can then be used from Python or compiled to machine code.
  • Nuitka compiles Python into C.[155] This compiler works with Python 3.4 to 3.13 (and 2.6 and 2.7) for Python's main supported platforms (and Windows 7 or even Windows XP) and for Android. The compiler developers claim full support for Python 3.10, partial support for Python 3.11 and 3.12, and experimental support for Python 3.13. Nuitka supports macOS including Apple Silicon-based versions. The compiler is free of cost, though it has commercial add-ons (e.g., for hiding source code).
  • Numba is a JIT compiler that is used from Python; the compiler translates a subset of Python and NumPy code into fast machine code. This tool is enabled by adding a decorator to the relevant Python code.
  • Pythran compiles a subset of Python 3 to C++ (C++11).[156]
  • RPython can be compiled to C, and it is used to build the PyPy interpreter for Python.
  • The Python → 11l → C++ transpiler[157] compiles a subset of Python 3 to C++ (C++17).

There are also specialized compilers:

Some older projects existed, as well as compilers not designed for use with Python 3.x and related syntax:

  • Google's Grumpytranspiles Python 2 toGo.[158][159][160] The latest release was in 2017.
  • IronPython allows running Python 2.7 programs with the .NETCommon Language Runtime.[161] Analpha version (released in 2021), is available for "Python 3.4, although features and behaviors from later versions may be included."[162]
  • Jython compiles Python 2.7 to Java bytecode, allowing the use of Java libraries from a Python program.[163]
  • Pyrex (last released in 2010) andShed Skin (last released in 2013) compile to C and C++ respectively.

Performance

[edit]

A performance comparison among various Python implementations, using a non-numerical (combinatorial) workload, was presented at EuroSciPy '13.[164] In addition, Python's performance relative to other programming languages is benchmarked byThe Computer Language Benchmarks Game.[165]

There are several approaches to optimizing Python performance, despite the inherent slowness of aninterpreted language. These approaches include the following strategies or tools:

  • Just-in-time compilation: Dynamically compiling parts of a Python program during the execution of the program. This technique is used in libraries such asNumba andPyPy.
  • Static compilation: Sometimes, Python code can be compiled into machine code sometime before execution. An example of this approach isCython, which compiles Python into C.
  • Concurrency andparallelism: Multiple tasks can be run simultaneously. Python contains modules such as `multiprocessing` to support this form of parallelism. Moreover, this approach helps to overcome limitations of theGlobal Interpreter Lock (GIL) in CPU tasks.
  • Efficientdata structures: Performance can also be improved by using data types such asSet for membership tests, ordeque fromcollections forqueue operations.
  • Performance gains can be observed by utilizing libraries such asNumPy. Most high performance Python libraries useC orFortran under the hood instead of the Python interpreter.[166]

Language Development

[edit]

Python's development is conducted mostly through thePython Enhancement Proposal (PEP) process; this process is the primary mechanism for proposing major new features, collecting community input on issues, and documenting Python design decisions.[167] Python coding style is covered in PEP 8.[83] Outstanding PEPs are reviewed and commented on by the Python community and the steering council.[167]

Enhancement of the language corresponds with development of the CPython reference implementation. The mailing list python-dev is the primary forum for the language's development. Specific issues were originally discussed in theRoundupbug tracker hosted by the foundation.[168] In 2022, all issues and discussions were migrated toGitHub.[169] Development originally took place on aself-hosted source-code repository runningMercurial, until Python moved toGitHub in January 2017.[170]

CPython's public releases have three types, distinguished by which part of the version number is incremented:

  • Backward-incompatible versions, where code is expected to break and must be manuallyported. The first part of the version number is incremented. These releases happen infrequently—version 3.0 was released 8 years after 2.0. According to Guido van Rossum, a version 4.0 will probably never exist.[171]
  • Major or "feature" releases are largely compatible with the previous version but introduce new features. The second part of the version number is incremented. Starting with Python 3.9, these releases are expected to occur annually.[172][173] Each major version is supported by bug fixes for several years after its release.[174]
  • Bug fix releases,[175] which introduce no new features, occur approximately every three months; these releases are made when a sufficient number of bugs have been fixedupstream since the last release. Security vulnerabilities are also patched in these releases. The third and final part of the version number is incremented.[175]

Manyalpha, beta, and release-candidates are also released as previews and for testing before final releases. Although there is a rough schedule for releases, they are often delayed if the code is not ready yet. Python's development team monitors the state of the code by running a largeunit test suite during development.[176]

The majoracademic conference on Python isPyCon. Also, there are special Python mentoring programs, such asPyLadies.

Naming

[edit]

Python's name is inspired by the British comedy groupMonty Python, whom Python creator Guido van Rossum enjoyed while developing the language. Monty Python references appear frequently in Python code and culture;[177] for example, themetasyntactic variables often used in Python literature arespam andeggs, rather than the traditionalfoo andbar.[177][178] Also, the official Python documentation contains various references to Monty Python routines.[179][180] Python users are sometimes referred to as "Pythonistas".[181]

Languages influenced by Python

[edit]

See also

[edit]

Notes

[edit]
  1. ^since 3.5, but those hints are ignored, except with unofficial tools[5]
  2. ^
  3. ^del in Python does not behave the same waydelete in languages such asC++ does, where such a word is used to call thedestructor and deallocate heap memory.

References

[edit]
  1. ^"General Python FAQ – Python 3 documentation".docs.python.org. Retrieved7 July 2024.
  2. ^"Python 0.9.1 part 01/21". alt.sources archives.Archived from the original on 11 August 2021. Retrieved11 August 2021.
  3. ^Hugo van Kemenade (7 October 2025)."Python Insider: Python 3.14.0 (final) is here!". Retrieved7 October 2025.
  4. ^"Why is Python a dynamic language and also a strongly typed language".Python Wiki.Archived from the original on 14 March 2021. Retrieved27 January 2021.
  5. ^abvan Rossum, Guido; Levkivskyi, Ivan."PEP 483 – The Theory of Type Hints".Python Enhancement Proposals (PEPs).Archived from the original on 14 June 2020. Retrieved14 June 2018.
  6. ^"PEP 738 – Adding Android as a supported platform | peps.python.org".Python Enhancement Proposals (PEPs). Retrieved19 May 2024.
  7. ^ab"Download Python for Other Platforms".Python.org.Archived from the original on 27 November 2020. Retrieved18 August 2023.
  8. ^"test – Regression tests package for Python".Python 3.7.17 documentation.Archived from the original on 17 May 2022. Retrieved17 May 2022.
  9. ^"platform – Access to underlying platform's identifying data".Python 3.10.4 documentation.Archived from the original on 17 May 2022. Retrieved17 May 2022.
  10. ^Holth, Daniel; Moore, Paul (30 March 2014)."PEP 0441 – Improving Python ZIP Application Support".Python Enhancement Proposals (PEPs).Archived from the original on 26 December 2018. Retrieved12 November 2015.
  11. ^"Starlark Language".bazel.build.Archived from the original on 15 June 2020. Retrieved25 May 2019.
  12. ^ab"Why was Python created in the first place?".General Python FAQ. Python Software Foundation.Archived from the original on 24 October 2012. Retrieved22 March 2007.I had extensive experience with implementing an interpreted language in the ABC group at CWI, and from working with this group I had learned a lot about language design. This is the origin of many Python features, including the use of indentation for statement grouping and the inclusion of very high-level data types (although the details are all different in Python).
  13. ^"Ada 83 Reference Manual (raise statement)".archive.adaic.com.Archived from the original on 22 October 2019. Retrieved7 January 2020.
  14. ^abKuchling, Andrew M. (22 December 2006)."Interview with Guido van Rossum (July 1998)".amk.ca. Archived fromthe original on 1 May 2007. Retrieved12 March 2012.I'd spent a summer at DEC's Systems Research Center, which introduced me to Modula-2+; the Modula-3 final report was being written there at about the same time. What I learned there later showed up in Python's exception handling, modules, and the fact that methods explicitly contain 'self' in their parameter list. String slicing came from Algol-68 and Icon.
  15. ^abc"itertools – Functions creating iterators for efficient looping".Python 3.7.17 documentation.Archived from the original on 14 June 2020. Retrieved22 November 2016.This module implements a number of iterator building blocks inspired by constructs from APL, Haskell, and SML.
  16. ^van Rossum, Guido (1993). "An Introduction to Python for UNIX/C Programmers".Proceedings of the NLUUG Najaarsconferentie (Dutch UNIX Users Group).CiteSeerX 10.1.1.38.2023.even though the design of C is far from ideal, its influence on Python is considerable.
  17. ^ab"Classes".The Python Tutorial. Python Software Foundation.Archived from the original on 23 October 2012. Retrieved20 February 2012.It is a mixture of the class mechanisms found in C++ and Modula-3
  18. ^Lundh, Fredrik."Call By Object".effbot.org.Archived from the original on 23 November 2019. Retrieved21 November 2017.replace "CLU" with "Python", "record" with "instance", and "procedure" with "function or method", and you get a pretty accurate description of Python's object model.
  19. ^Simionato, Michele."The Python 2.3 Method Resolution Order". Python Software Foundation.Archived from the original on 20 August 2020. Retrieved29 July 2014.The C3 method itself has nothing to do with Python, since it was invented by people working on Dylan and it is described in a paper intended for lispers
  20. ^Kuchling, A. M."Functional Programming HOWTO".Python v2.7.2 documentation. Python Software Foundation.Archived from the original on 24 October 2012. Retrieved9 February 2012.List comprehensions and generator expressions [...] are a concise notation for such operations, borrowed from the functional programming language Haskell.
  21. ^Schemenauer, Neil; Peters, Tim; Hetland, Magnus Lie (18 May 2001)."PEP 255 – Simple Generators".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 5 June 2020. Retrieved9 February 2012.
  22. ^"More Control Flow Tools".Python 3 documentation. Python Software Foundation.Archived from the original on 4 June 2016. Retrieved24 July 2015.By popular demand, a few features commonly found in functional programming languages like Lisp have been added to Python. With the lambda keyword, small anonymous functions can be created.
  23. ^"re – Regular expression operations".Python 3.10.6 documentation.Archived from the original on 18 July 2018. Retrieved6 September 2022.This module provides regular expression matching operations similar to those found in Perl.
  24. ^"CoffeeScript".coffeescript.org.Archived from the original on 12 June 2020. Retrieved3 July 2018.
  25. ^Rauschmayer, Axel (24 February 2013)."Perl and Python influences in JavaScript".2ality.com.Archived from the original on 26 December 2018. Retrieved15 May 2015.
  26. ^Rauschmayer, Axel."Chapter 3: The Nature of JavaScript; Influences".Speaking JavaScript. O'Reilly.Archived from the original on 26 December 2018. Retrieved15 May 2015.
  27. ^Bezanson, Jeff; Karpinski, Stefan; Shah, Viral B.; Edelman, Alan (February 2012)."Why We Created Julia".Julia website.Archived from the original on 2 May 2020. Retrieved5 June 2014.We want something as usable for general programming as Python [...]
  28. ^abKrill, Paul (4 May 2023)."Mojo language marries Python and MLIR for AI development".InfoWorld.Archived from the original on 5 May 2023. Retrieved5 May 2023.
  29. ^abRing Team (4 December 2017)."Ring and other languages".ring-lang.net.ring-lang. Archived fromthe original on 25 December 2018. Retrieved4 December 2017.
  30. ^abBini, Ola (2007).Practical JRuby on Rails Web 2.0 Projects: bringing Ruby on Rails to the Java platform. Berkeley: APress. p. 3.ISBN 978-1-59059-881-8.
  31. ^abLattner, Chris (3 June 2014)."Chris Lattner's Homepage". Chris Lattner.Archived from the original on 25 December 2018. Retrieved3 June 2014.The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.
  32. ^ab"V documentation (Introduction)".GitHub. Retrieved24 December 2024.
  33. ^Kuhlman, Dave."A Python Book: Beginning Python, Advanced Python, and Python Exercises". Section 1.1. Archived fromthe original(PDF) on 23 June 2012.
  34. ^"PEP 484 – Type Hints".Python Enhancement Proposals. Retrieved27 October 2025.
  35. ^"mypy – Optional Static Typing for Python".mypy-lang.org. Retrieved17 August 2025.
  36. ^"Stack Overflow Developer Survey 2022".Stack Overflow.Archived from the original on 27 June 2022. Retrieved12 August 2022.
  37. ^"The State of Developer Ecosystem in 2020 Infographic".JetBrains.Archived from the original on 1 March 2021. Retrieved5 March 2021.
  38. ^"TIOBE Index". TIOBE.Archived from the original on 25 February 2018. Retrieved3 January 2023.The TIOBE Programming Community index is an indicator of the popularity of programming languages Updated as required.
  39. ^Healy, John; McInnes, Leland; Weir, Colin (2017). "Bridging the Cyber-Analysis Gap: The Democratization of Data Science".The Cyber Defense Review.2 (1):109–118.ISSN 2474-2120.JSTOR 26267404.Python is the lingua franca of data science and machine learning.
  40. ^Sultana, Simon G.; Reed, Philip A. (2017). "Curriculum for an Introductory Computer Science Course: Identifying Recommendations from Academia and Industry".The Journal of Technology Studies.43 (2):80–92.doi:10.21061/jots.v43i2.a.3.ISSN 1071-6084.JSTOR 90023144.
  41. ^"TIOBE Index". TIOBE.Archived from the original on 25 February 2018. Retrieved3 January 2023.The TIOBE Programming Community index is an indicator of the popularity of programming languages
  42. ^abVenners, Bill (13 January 2003)."The Making of Python".Artima Developer. Artima.Archived from the original on 1 September 2016. Retrieved22 March 2007.
  43. ^abcvan Rossum, Guido (20 January 2009)."A Brief Timeline of Python".The History of Python.Archived from the original on 5 June 2020. Retrieved20 January 2009.
  44. ^van Rossum, Guido (29 August 2000)."SETL (was: Lukewarm about range literals)".Python-Dev (Mailing list).Archived from the original on 14 July 2018. Retrieved13 March 2011.
  45. ^Fairchild, Carlie (12 July 2018)."Guido van Rossum Stepping Down from Role as Python's Benevolent Dictator For Life".Linux Journal.Archived from the original on 13 July 2018. Retrieved13 July 2018.
  46. ^Smith, Nathaniel J.; Durbin, Ee."PEP 8100 – January 2019 Steering Council election".Python Enhancement Proposals (PEPs). Python Software Foundation.Archived from the original on 4 June 2020. Retrieved4 May 2019.
  47. ^The Python core team and community."PEP 13 – Python Language Governance".Python Enhancement Proposals (PEPs).Archived from the original on 27 May 2021. Retrieved25 August 2021.
  48. ^Briggs, Jason R.; Lipovača, Miran (2013).Python for kids: a playful introduction to programming. San Francisco, California, USA: No Starch Press.ISBN 978-1-59327-407-8.LCCN 2012044047.OCLC 825076499.OL 26119645M.
  49. ^Kuchling, A. M.; Zadka, Moshe (16 October 2000)."What's New in Python 2.0". Python Software Foundation.Archived from the original on 23 October 2012. Retrieved11 February 2012.
  50. ^Peterson, Benjamin."PEP 373 – Python 2.7 Release Schedule".python.org.Archived from the original on 19 May 2020. Retrieved9 January 2017.
  51. ^Coghlan, Alyssa."PEP 466 – Network Security Enhancements for Python 2.7.x".Python Enhancement Proposals (PEPs).Archived from the original on 4 June 2020. Retrieved9 January 2017.
  52. ^"Sunsetting Python 2".Python.org.Archived from the original on 12 January 2020. Retrieved22 September 2019.
  53. ^Peterson, Benjamin."PEP 373 – Python 2.7 Release Schedule".Python Enhancement Proposals (PEPs).Archived from the original on 13 January 2020. Retrieved22 September 2019.
  54. ^mattip (25 December 2023)."PyPy v7.3.14 release".PyPy.Archived from the original on 5 January 2024. Retrieved5 January 2024.
  55. ^Peterson, Benjamin (20 April 2020)."Python 2.7.18, the last release of Python 2".Python Insider.Archived from the original on 26 April 2020. Retrieved27 April 2020.
  56. ^"Status of Python versions".Python Developer's Guide. Retrieved12 November 2025.
  57. ^The Cain Gang Ltd."Python Metaclasses: Who? Why? When?"(PDF). Archived fromthe original(PDF) on 30 May 2009. Retrieved27 June 2009.
  58. ^"3.3. Special method names".The Python Language Reference. Python Software Foundation.Archived from the original on 15 December 2018. Retrieved27 June 2009.
  59. ^"PyDBC: method preconditions, method postconditions and class invariants for Python".Archived from the original on 23 November 2019. Retrieved24 September 2011.
  60. ^"Contracts for Python".Archived from the original on 15 June 2020. Retrieved24 September 2011.
  61. ^"PyDatalog".Archived from the original on 13 June 2020. Retrieved22 July 2012.
  62. ^"Glue it all together with Python".Python.org. Retrieved30 September 2024.
  63. ^"Reference counts". Extending and embedding the Python interpreter.Docs.python.org.Archived from the original on 18 October 2012. Retrieved5 June 2020.Since Python makes heavy use ofmalloc() andfree()}, it needs a strategy to avoid memory leaks as well as the re‑use of freed memory. The method chosen is calledreference counting.
  64. ^abHettinger, Raymond (30 January 2002)."PEP 289 – Generator Expressions".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 14 June 2020. Retrieved19 February 2012.
  65. ^"6.5 itertools – Functions creating iterators for efficient looping". Docs.python.org.Archived from the original on 14 June 2020. Retrieved22 November 2016.
  66. ^abPeters, Tim (19 August 2004)."PEP 20 – The Zen of Python".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 26 December 2018. Retrieved24 November 2008.
  67. ^Lutz, Mark (January 2022)."Python changes 2014+".Learning Python.Archived from the original on 15 March 2024. Retrieved25 February 2024.
  68. ^"Confusion regarding a rule in 'the Zen of Python'". Discussions.Python.org. Python help. 3 May 2022.Archived from the original on 25 February 2024. Retrieved25 February 2024.
  69. ^Ambi, Chetan (4 July 2021)."The most controversial Python 'walrus operator'".Python simplified (pythonsimplified.com).Archived from the original on 27 August 2023. Retrieved5 February 2024.
  70. ^Grifski, Jeremy (24 May 2020)."The controversy behind the 'walrus operator' in Python".The Renegade Coder (therenegadecoder.com).Archived from the original on 28 December 2023. Retrieved25 February 2024.
  71. ^"[Python-ideas] PEP 315: do-while". 26 June 2013.
  72. ^Bader, Dan."Python string formatting best practices".Real Python (realpython.com).Archived from the original on 18 February 2024. Retrieved25 February 2024.
  73. ^Martelli, Alex; Ravenscroft, Anna; Ascher, David (2005).Python Cookbook, 2nd Edition.O'Reilly Media. p. 230.ISBN 978-0-596-00797-3.Archived from the original on 23 February 2020. Retrieved14 November 2015.
  74. ^"Python Culture".ebeab. 21 January 2014. Archived fromthe original on 30 January 2014.
  75. ^ab"Transpiling Python to Julia using PyJL"(PDF).Archived(PDF) from the original on 19 November 2023. Retrieved20 September 2023.After manually modifying one line of code by specifying the necessary type information, we obtained a speedup of 52.6×, making the translated Julia code 19.5× faster than the original Python code.
  76. ^"Why is it called Python?".General Python FAQ. Docs.python.org.Archived from the original on 24 October 2012. Retrieved3 January 2023.
  77. ^"15 ways Python is a powerful force on the web". Archived fromthe original on 11 May 2019. Retrieved3 July 2018.
  78. ^"pprint – data pretty printer –Python 3.11.0 documentation".docs.python.org.Archived from the original on 22 January 2021. Retrieved5 November 2022.stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni']
  79. ^"Code style". The hitchhiker's guide to Python.docs.python-guide.org.Archived from the original on 27 January 2021. Retrieved20 January 2021.
  80. ^"Is Python a good language for beginning programmers?".General Python FAQ. Python Software Foundation.Archived from the original on 24 October 2012. Retrieved21 March 2007.
  81. ^"Myths about indentation in Python". Secnetix.de. Archived fromthe original on 18 February 2018. Retrieved19 April 2011.
  82. ^Guttag, John V. (12 August 2016).Introduction to Computation and Programming Using Python: With Application to Understanding Data. MIT Press.ISBN 978-0-262-52962-4.
  83. ^abvan Rossum, Guido; Warsaw, Barry."PEP 8 – Style Guide for Python Code".Python Enhancement Proposals (PEPs).Archived from the original on 17 April 2019. Retrieved26 March 2019.
  84. ^"8. Errors and Exceptions – Python 3.12.0a0 documentation".docs.python.org.Archived from the original on 9 May 2022. Retrieved9 May 2022.
  85. ^"Highlights: Python 2.5".Python.org.Archived from the original on 4 August 2019. Retrieved20 March 2018.
  86. ^van Rossum, Guido (22 April 2009)."Tail Recursion Elimination". Neopythonic.blogspot.be.Archived from the original on 19 May 2018. Retrieved3 December 2012.
  87. ^van Rossum, Guido (9 February 2006)."Language Design Is Not Just Solving Puzzles".Artima forums. Artima.Archived from the original on 17 January 2020. Retrieved21 March 2007.
  88. ^van Rossum, Guido; Eby, Phillip J. (10 May 2005)."PEP 342 – Coroutines via Enhanced Generators".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 29 May 2020. Retrieved19 February 2012.
  89. ^"PEP 380". Python.org.Archived from the original on 4 June 2020. Retrieved3 December 2012.
  90. ^"division".python.org.Archived from the original on 20 July 2006. Retrieved30 July 2014.
  91. ^"PEP 0465 – A dedicated infix operator for matrix multiplication".python.org.Archived from the original on 4 June 2020. Retrieved1 January 2016.
  92. ^"Python 3.5.1 Release and Changelog".python.org.Archived from the original on 14 May 2020. Retrieved1 January 2016.
  93. ^"What's New in Python 3.8".Archived from the original on 8 June 2020. Retrieved14 October 2019.
  94. ^van Rossum, Guido; Hettinger, Raymond (7 February 2003)."PEP 308 – Conditional Expressions".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 13 March 2016. Retrieved13 July 2011.
  95. ^"4. Built-in Types – Python 3.6.3rc1 documentation".python.org.Archived from the original on 14 June 2020. Retrieved1 October 2017.
  96. ^"5.3. Tuples and Sequences – Python 3.7.1rc2 documentation".python.org.Archived from the original on 10 June 2020. Retrieved17 October 2018.
  97. ^ab"PEP 498 – Literal String Interpolation".python.org.Archived from the original on 15 June 2020. Retrieved8 March 2017.
  98. ^"The Python Language Reference, section 3.3. New-style and classic classes, for release 2.7.1". Archived fromthe original on 26 October 2012. Retrieved12 January 2011.
  99. ^"PEP 484 – Type Hints | peps.python.org".peps.python.org.Archived from the original on 27 November 2023. Retrieved29 November 2023.
  100. ^"typing — Support for type hints".Python documentation. Python Software Foundation.Archived from the original on 21 February 2020. Retrieved22 December 2023.
  101. ^"mypy – Optional Static Typing for Python".Archived from the original on 6 June 2020. Retrieved28 January 2017.
  102. ^"Introduction".mypyc.readthedocs.io.Archived from the original on 22 December 2023. Retrieved22 December 2023.
  103. ^"15. Floating Point Arithmetic: Issues and Limitations – Python 3.8.3 documentation".docs.python.org.Archived from the original on 6 June 2020. Retrieved6 June 2020.Almost all machines today (November 2000) use IEEE-754 floating point arithmetic, and almost all platforms map Python floats to IEEE-754 "double precision".
  104. ^Zadka, Moshe; van Rossum, Guido (11 March 2001)."PEP 237 – Unifying Long Integers and Integers".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 28 May 2020. Retrieved24 September 2011.
  105. ^"Built-in Types".Archived from the original on 14 June 2020. Retrieved3 October 2019.
  106. ^"PEP 465 – A dedicated infix operator for matrix multiplication".python.org.Archived from the original on 29 May 2020. Retrieved3 July 2018.
  107. ^abZadka, Moshe; van Rossum, Guido (11 March 2001)."PEP 238 – Changing the Division Operator".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 28 May 2020. Retrieved23 October 2013.
  108. ^"Why Python's Integer Division Floors". 24 August 2010.Archived from the original on 5 June 2020. Retrieved25 August 2010.
  109. ^"round",The Python standard library, release 3.2, §2: Built-in functions,archived from the original on 25 October 2012, retrieved14 August 2011
  110. ^"round",The Python standard library, release 2.7, §2: Built-in functions,archived from the original on 27 October 2012, retrieved14 August 2011
  111. ^Beazley, David M. (2009).Python Essential Reference (4th ed.). Addison-Wesley Professional. p. 66.ISBN 978-0-672-32978-4.
  112. ^Kernighan, Brian W.; Ritchie, Dennis M. (1988).The C Programming Language (2nd ed.). p. 206.
  113. ^abBatista, Facundo (17 October 2003)."PEP 327 – Decimal Data Type".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 4 June 2020. Retrieved24 November 2008.
  114. ^"What's New in Python 2.6".Python v2.6.9 documentation. 29 October 2013.Archived from the original on 23 December 2019. Retrieved26 September 2015.
  115. ^"10 Reasons Python Rocks for Research (And a Few Reasons it Doesn't) – Hoyt Koepke".University of Washington Department of Statistics. Archived fromthe original on 31 May 2020. Retrieved3 February 2019.
  116. ^Shell, Scott (17 June 2014)."An introduction to Python for scientific computing"(PDF).Archived(PDF) from the original on 4 February 2019. Retrieved3 February 2019.
  117. ^Piotrowski, Przemyslaw (July 2006)."Build a Rapid Web Development Environment for Python Server Pages and Oracle".Oracle Technology Network. Oracle.Archived from the original on 2 April 2019. Retrieved12 March 2012.
  118. ^Eby, Phillip J. (7 December 2003)."PEP 333 – Python Web Server Gateway Interface v1.0".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 14 June 2020. Retrieved19 February 2012.
  119. ^"PyPI".PyPI. 13 March 2025.Archived from the original on 22 February 2025.
  120. ^"Glossary: interactive".Python documentation. v3.13.7. Retrieved31 August 2025.
  121. ^ab"IDLE — Python editor and shell".Python documentation. v3.13.7. Retrieved31 August 2025.IDLE is Python's Integrated Development and Learning Environment.
  122. ^"IPython Documentation". v9.5.0. 29 August 2025.Archived from the original on 31 August 2025. Retrieved31 August 2025.
  123. ^"Project Jupyter".Jupyter.org.Archived from the original on 12 October 2023. Retrieved2 April 2025.
  124. ^Harper, Doug (Spring 2024)."Enthought Canopy".WKU Physics 316.Western Kentucky University.Archived from the original on 18 August 2024. Retrieved31 August 2025.
  125. ^"Enthought Canopy".Enthought. Archived fromthe original on 15 July 2017. Retrieved20 August 2016.
  126. ^"PEP 7 – Style Guide for C Code | peps.python.org".peps.python.org.Archived from the original on 24 April 2022. Retrieved28 April 2022.
  127. ^"4. Building C and C++ Extensions – Python 3.9.2 documentation".docs.python.org.Archived from the original on 3 March 2021. Retrieved1 March 2021.
  128. ^van Rossum, Guido (5 June 2001)."PEP 7 – Style Guide for C Code".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 1 June 2020. Retrieved24 November 2008.
  129. ^"CPython byte code". Docs.python.org.Archived from the original on 5 June 2020. Retrieved16 February 2016.
  130. ^"Python 2.5 internals"(PDF).Archived(PDF) from the original on 6 August 2012. Retrieved19 April 2011.
  131. ^"Changelog – Python 3.9.0 documentation".docs.python.org.Archived from the original on 7 February 2021. Retrieved8 February 2021.
  132. ^"Download Python".Python.org.Archived from the original on 8 December 2020. Retrieved13 December 2020.
  133. ^"history [vmspython]".www.vmspython.org.Archived from the original on 2 December 2020. Retrieved4 December 2020.
  134. ^"An Interview with Guido van Rossum". Oreilly.com.Archived from the original on 16 July 2014. Retrieved24 November 2008.
  135. ^abcPereira, Rui; Couto, Marco; Ribeiro, Francisco; Rua, Rui; Cunha, Jácome; Fernandes, João Paulo; Saraiva, João (23 October 2017)."Energy efficiency across programming languages: How do energy, time, and memory relate?".Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering. SLE 2017. New York, NY, USA: Association for Computing Machinery. pp. 256–267.doi:10.1145/3136014.3136031.ISBN 978-1-4503-5525-4.
  136. ^"What PyInstaller Does and How It Does It".
  137. ^"PyPy compatibility". Pypy.org.Archived from the original on 6 June 2020. Retrieved3 December 2012.
  138. ^Team, The PyPy (28 December 2019)."Download and Install".PyPy.Archived from the original on 8 January 2022. Retrieved8 January 2022.
  139. ^"speed comparison between CPython and Pypy". Speed.pypy.org.Archived from the original on 10 May 2021. Retrieved3 December 2012.
  140. ^"Codon: Differences with Python".Archived from the original on 25 May 2023. Retrieved28 August 2023.
  141. ^Lawson, Loraine (14 March 2023)."MIT-Created Compiler Speeds up Python Code".The New Stack.Archived from the original on 6 April 2023. Retrieved28 August 2023.
  142. ^"Python-for-EV3".LEGO Education.Archived from the original on 7 June 2020. Retrieved17 April 2019.
  143. ^Yegulalp, Serdar (29 October 2020)."Pyston returns from the dead to speed Python".InfoWorld.Archived from the original on 27 January 2021. Retrieved26 January 2021.
  144. ^"cinder: Instagram's performance-oriented fork of CPython".GitHub.Archived from the original on 4 May 2021. Retrieved4 May 2021.
  145. ^Aroca, Rafael (7 August 2021)."Snek Lang: feels like Python on Arduinos".Yet Another Technology Blog.Archived from the original on 5 January 2024. Retrieved4 January 2024.
  146. ^Aufranc (CNXSoft), Jean-Luc (16 January 2020)."Snekboard Controls LEGO Power Functions with CircuitPython or Snek Programming Languages (Crowdfunding) – CNX Software".CNX Software – Embedded Systems News.Archived from the original on 5 January 2024. Retrieved4 January 2024.
  147. ^Kennedy (@mkennedy), Michael."Ready to find out if you're git famous?".pythonbytes.fm.Archived from the original on 5 January 2024. Retrieved4 January 2024.
  148. ^Packard, Keith (20 December 2022)."The Snek Programming Language: A Python-inspired Embedded Computing Language"(PDF).Archived(PDF) from the original on 4 January 2024. Retrieved4 January 2024.
  149. ^"Application-level Stackless features – PyPy 2.0.2 documentation". Doc.pypy.org.Archived from the original on 4 June 2020. Retrieved17 July 2013.
  150. ^"Plans for optimizing Python".Google Project Hosting. 15 December 2009.Archived from the original on 11 April 2016. Retrieved24 September 2011.
  151. ^"Python on the Nokia N900".Stochastic Geometry. 29 April 2010.Archived from the original on 20 June 2019. Retrieved9 July 2015.
  152. ^"Brython".brython.info.Archived from the original on 3 August 2018. Retrieved21 January 2021.
  153. ^"Transcrypt – Python in the browser".transcrypt.org.Archived from the original on 19 August 2018. Retrieved22 December 2020.
  154. ^"Transcrypt: Anatomy of a Python to JavaScript Compiler".InfoQ.Archived from the original on 5 December 2020. Retrieved20 January 2021.
  155. ^"Nuitka Home | Nuitka Home".nuitka.net.Archived from the original on 30 May 2020. Retrieved18 August 2017.
  156. ^Guelton, Serge; Brunet, Pierrick; Amini, Mehdi; Merlini, Adrien; Corbillon, Xavier; Raynaud, Alan (16 March 2015)."Pythran: enabling static optimization of scientific Python programs".Computational Science & Discovery.8 (1) 014001. IOP Publishing.Bibcode:2015CS&D....8a4001G.doi:10.1088/1749-4680/8/1/014001.ISSN 1749-4699.
  157. ^"The Python → 11l → C++ transpiler".Archived from the original on 24 September 2022. Retrieved17 July 2022.
  158. ^"google/grumpy". 10 April 2020.Archived from the original on 15 April 2020. Retrieved25 March 2020 – via GitHub.
  159. ^"Projects".opensource.google.Archived from the original on 24 April 2020. Retrieved25 March 2020.
  160. ^Francisco, Thomas Claburn in San."Google's Grumpy code makes Python Go".www.theregister.com.Archived from the original on 7 March 2021. Retrieved20 January 2021.
  161. ^"IronPython.net /".ironpython.net.Archived from the original on 17 April 2021.
  162. ^"GitHub – IronLanguages/ironpython3: Implementation of Python 3.x for .NET Framework that is built on top of the Dynamic Language Runtime".GitHub.Archived from the original on 28 September 2021.
  163. ^"Jython FAQ".www.jython.org.Archived from the original on 22 April 2021. Retrieved22 April 2021.
  164. ^Murri, Riccardo (2013).Performance of Python runtimes on a non-numeric scientific code. European Conference on Python in Science (EuroSciPy).arXiv:1404.6388.Bibcode:2014arXiv1404.6388M.
  165. ^"The Computer Language Benchmarks Game".Archived from the original on 14 June 2020. Retrieved30 April 2020.
  166. ^Python, Real."Look Ma, No for Loops: Array Programming With NumPy – Real Python".realpython.com. Retrieved15 October 2025.
  167. ^abWarsaw, Barry; Hylton, Jeremy; Goodger, David (13 June 2000)."PEP 1 – PEP Purpose and Guidelines".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 6 June 2020. Retrieved19 April 2011.
  168. ^Cannon, Brett."Guido, Some Guys, and a Mailing List: How Python is Developed".python.org. Python Software Foundation. Archived fromthe original on 1 June 2009. Retrieved27 June 2009.
  169. ^Edge, Jake (23 February 2022)."Moving Python's bugs to GitHub [LWN.net]".Archived from the original on 2 October 2022. Retrieved2 October 2022.
  170. ^"Python Developer's Guide – Python Developer's Guide".devguide.python.org.Archived from the original on 9 November 2020. Retrieved17 December 2019.
  171. ^Hughes, Owen (24 May 2021)."Programming languages: Why Python 4.0 might never arrive, according to its creator".TechRepublic.Archived from the original on 14 July 2022. Retrieved16 May 2022.
  172. ^"PEP 602 – Annual Release Cycle for Python".Python.org.Archived from the original on 14 June 2020. Retrieved6 November 2019.
  173. ^Edge, Jake (23 October 2019)."Changing the Python release cadence [LWN.net]".lwn.net.Archived from the original on 6 November 2019. Retrieved6 November 2019.
  174. ^Norwitz, Neal (8 April 2002)."[Python-Dev] Release Schedules (was Stability & change)".Archived from the original on 15 December 2018. Retrieved27 June 2009.
  175. ^abAahz; Baxter, Anthony (15 March 2001)."PEP 6 – Bug Fix Releases".Python Enhancement Proposals. Python Software Foundation.Archived from the original on 5 June 2020. Retrieved27 June 2009.
  176. ^"Python Buildbot".Python Developer's Guide. Python Software Foundation.Archived from the original on 5 June 2020. Retrieved24 September 2011.
  177. ^ab"Whetting Your Appetite".The Python Tutorial. Python Software Foundation.Archived from the original on 26 October 2012. Retrieved20 February 2012.
  178. ^"In Python, should I use else after a return in an if block?".Stack Overflow. Stack Exchange. 17 February 2011.Archived from the original on 20 June 2019. Retrieved6 May 2011.
  179. ^Lutz 2013, p. 17.
  180. ^Fehily, Chris (2002).Python. Peachpit Press. p. xv.ISBN 978-0-201-74884-0.Archived from the original on 17 July 2017. Retrieved9 May 2017.
  181. ^Lubanovic, Bill (2014).Introducing Python. Sebastopol, CA : O'Reilly Media. p. 305.ISBN 978-1-4493-5936-2. Retrieved31 July 2023.
  182. ^Esterbrook, Charles."Acknowledgements".cobra-language.com. Cobra Language. Archived fromthe original on 8 February 2008. Retrieved7 April 2010.
  183. ^"Proposals: iterators and generators [ES4 Wiki]". wiki.ecmascript.org. Archived fromthe original on 20 October 2007. Retrieved24 November 2008.
  184. ^Kincaid, Jason (10 November 2009)."Google's Go: A New Programming Language That's Python Meets C++".TechCrunch.Archived from the original on 18 January 2010. Retrieved29 January 2010.
  185. ^"Why We Created Julia".Julia website. February 2012.Archived from the original on 2 May 2020. Retrieved5 June 2014.We want something as usable for general programming as Python [...]
  186. ^"Modular Docs – Why Mojo".docs.modular.com.Archived from the original on 5 May 2023. Retrieved5 May 2023.Mojo as a member of the Python family [..] Embracing Python massively simplifies our design efforts, because most of the syntax is already specified. [..] we decided that the right long-term goal for Mojo is to provide a superset of Python (i.e. be compatible with existing programs) and to embrace the CPython immediately for long-tail ecosystem enablement. To a Python programmer, we expect and hope that Mojo will be immediately familiar, while also providing new tools for developing systems-level code that enable you to do things that Python falls back to C and C++ for.
  187. ^Spencer, Michael (4 May 2023)."What is Mojo Programming Language?".datasciencelearningcenter.substack.com.Archived from the original on 5 May 2023. Retrieved5 May 2023.
  188. ^"GDScript".gdscript.com. Retrieved24 November 2025.

Sources

[edit]

Further reading

[edit]

External links

[edit]
Python at Wikipedia'ssister projects
Implementations
IDEs
Topics
Designer
Differentiable computing
General
Hardware
Software libraries
General
Software
packages
Community
Organisations
Licenses
Types and
standards
Challenges
Related
topics
Public domain
Open-source
Freeware
Commercial
Cross-platform
Windows only
Excel add-ons
Free
Discontinued
Proprietary
International
National
Other
Retrieved from "https://en.wikipedia.org/w/index.php?title=Python_(programming_language)&oldid=1323956455"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp