Python versions

Creates, edits, modifies and integrates applications
Oct 5, 2020
Review
Oct 14, 2019
Review
Jun 27, 2018
Review
Dec 23, 2016
Review
Sep 13, 2015
Review
Mar 16, 2014
Review
Sep 29, 2012
Review
Feb 20, 2011
Review
Jun 27, 2009
Editorial review
rating
Jul 3, 2010
Oct 1, 2008
Editorial review
rating
Sep 19, 2004
Review
Nov 30, 2004
Dec 21, 2001
Editorial review
rating

What's new

v3.9.101.1013 [Oct 5, 2020]
New syntax features:
- PEP 584, union operators added to dict;
- PEP 585, type hinting generics in standard collections;
- PEP 614, relaxed grammar restrictions on decorators.
New built-in features:
- PEP 616, string methods to remove prefixes and suffixes.
New features in the standard library:
- PEP 593, flexible function and variable annotations;
- os.pidfd_open() added that allows process management without races and signals.
Interpreter improvements:
- PEP 573, fast access to module state from methods of C extension types;
- PEP 617, CPython now uses a new parser based on PEG;
- a number of Python builtins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;
- garbage collection does not block on resurrected objects;
- a number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, math, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;
- a number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.
New library modules:
- PEP 615, the IANA Time Zone Database is now present in the standard library in the zoneinfo module;
- an implementation of a topological sort of a graph is now provided in the new graphlib module.
Release process changes:
- PEP 602, CPython adopts an annual release cycle.

v3.8.2150.1013 [Oct 14, 2019]
Security¶
- Audit hooks are now cleared later during finalization to avoid missing events.
- Ensure python3.dll is loaded from correct locations when Python is embedded (CVE-2020-15523).
Core and Builtins
- Always cache the running loop holder when running asyncio.set_running_loop.
- Fix incorrect refcounting in _ssl.c’s _servername_callback().
- Python 3.8.3 had a regression where compiling with ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension with CO_COROUTINE. Now only list comprehension making use of async/await will tagged as so.
- Guard against a NULL pointer dereference within bytearrayobject triggered by the bytearray() + bytearray() operation.
- The “hackcheck” that prevents sneaking around a type’s __setattr__() by calling the superclass method was rewritten to allow C implemented heap types.
Library
- Fix the error handling in ssl.SSLContext.load_dh_params().
- The write_history() atexit function of the readline completer now ignores any OSError to ignore error if the filesystem is read-only, instead of only ignoring FileNotFoundError and PermissionError.
- Fixed the use of glob() in the stdlib: literal part of the path is now always correctly escaped.
- Fixed email.contentmanager to allow set_content() to set a null string.
IDLE
- Add keywords to module name completion list. Rewrite Completions section of IDLE doc.
- The encoding of stdin, stdout and stderr in IDLE is now always UTF-8.

v3.5.4150 [Sep 13, 2015]
- PEP 441, improved Python zip application support
- PEP 448, additional unpacking generalizations
- PEP 461, "%-formatting" for bytes and bytearray objects
- PEP 465, a new operator (@) for matrix multiplication
- PEP 471, os.scandir(), a fast new directory traversal function
- PEP 475, adding support for automatic retries of interrupted system calls
- PEP 479, change StopIteration handling inside generators
- PEP 484, the typing module, a new standard for type annotations
- PEP 485, math.isclose(), a function for testing approximate equality
- PEP 486, making the Windows Python launcher aware of virtual environments
- PEP 488, eliminating .pyo files
- PEP 489, a new and improved mechanism for loading extension modules
- PEP 492, coroutines with async and await syntax.

v3.4.16789 [Mar 16, 2014]
1. Features:
- pip should always be available.
- Newly created file descriptors are non-inheritable.
- command line option for isolated mode.
- improvements in the handling of codecs that are not text encodings.
- A ModuleSpec Type for the Import System.
- The marshal format has been made more compact and efficient.
2. Library modules:
- asyncio: provisional API for asynchronous IO.
- ensurepip: Bootstrapping the pip installer.
- enum: Support for enumeration types.
- pathlib: Object-oriented filesystem paths.
- selectors: High-level and efficient I/O multiplexing, built upon the select module primitives.
- statistics: A basic numerically stable statistics library.
- tracemalloc: Trace Python memory allocations.
3. Security improvements:
- Secure and interchangeable hash algorithm.
- Make newly created file descriptors non-inheritable to avoid leaking file descriptors to child processes.
- Added command line option for isolated mode.
- multiprocessing now has an option to avoid using os.fork on Unix. spawn and forkserver are more secure because they avoid sharing data with child processes.
- multiprocessing child processes on Windows no longer inherit all of the parent’s inheritable handles, only the necessary ones.
- Added hashlib.pbkdf2_hmac() function provides the PKCS#5 password-based key derivation function 2.
- TLSv1.1 and TLSv1.2 support for ssl.
- Retrieving certificates from the Windows system cert store support for ssl.
- Server-side SNI (Server Name Indication) support for ssl.
- The ssl.SSLContext class has a lot of improvements.
- All modules in the standard library that support SSL now support server certificate verification, including hostname matching (ssl.match_hostname()) and CRLs (Certificate Revocation lists, see ssl.SSLContext.load_verify_locations()).
4. CPython implementation improvements:
- Safe object finalization.
- Configurable memory allocators.
- Argument Clinic.

v3.3.5150 [Sep 29, 2012]
New syntax features:
New yield from expression for generator delegation.
The u'unicode' syntax is accepted again for str objects.
New library modules:
faulthandler (helps debugging low-level crashes)
ipaddress (high-level objects representing IP addresses and masks)
lzma (compress data using the XZ / LZMA algorithm)
unittest.mock (replace parts of your system under test with mock objects)
venv (Python virtual environments, as in the popular virtualenv package)
New built-in features:
Reworked I/O exception hierarchy.
Implementation improvements:
Rewritten import machinery based on importlib.
More compact unicode strings.
More compact attribute dictionaries.
Significantly Improved Library Modules:
C Accelerator for the decimal module.
Better unicode handling in the email module (provisional).
Security improvements:
Hash randomization is switched on by default.

v3.2.5150 [Feb 20, 2011]
It mainly fixes a regression in the urllib.request module that prevented opening many HTTP resources correctly with Python 3.2.1.
Issue #12732: In narrow unicode builds, allow Unicode identifiers which fall
outside the BMP.
Issue #11603: Fix a crash when __str__ is rebound as __repr__. Patch by Andreas Stührk.
Issue #11321: Fix a crash with multiple imports of the _pickle module when embedding Python. Patch by Andreas Stührk.
Verify the types of AST strings and identifiers provided by the user before compiling them.
Issue #12579: str.format_map() now raises a ValueError if used on a format string that contains positional fields. Initial patch by Julian Berman.
Issue #11627: Fix segfault when __new__ on a exception returns a non-exception class.
Issue #12149: Update the method cache after a type's dictionnary gets cleared by the garbage collector. This fixes a segfault when an instance and its type get caught in a reference cycle, and the instance's deallocator calls one of the methods on the type (e.g. when subclassing
IOBase). Diagnosis and patch by Davide Rizzo.
When a generator yields, do not retain the caller's exception state on the generator.
Issue #12475: Prevent generators from leaking their exception state into the caller's frame as they return for the last time.
Library
Issue #11513: Fix exception handling ``tarfile.TarFile.gzopen()`` when the file cannot be opened.
Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles.
Issue #10087: Fix the html output format of the calendar module.
Issue #12540: Prevent zombie IDLE processes on Windows due to changes in os.kill().
Issue #12683: urlparse updated to include svn as schemes that uses relative paths. (svn from 1.5 onwards support relative path).
Issues #11104, #8688: Fix the behavior of distutils' sdist command with manually-maintained MANIFEST files.
Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow symlinks: fix it. Patch by Petri Lehtinen.
Issue #8887: "pydoc somebuiltin.somemethod" (or help('somebuiltin.somemethod') in Python code) now finds the doc of the method.
Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
Issue #12514: Use try/finally to assure the timeit module restores garbage collections when it is done.
Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is given as a low fd, it gets overwritten.
Issue #12590: IDLE editor window now always displays the first line when opening a long file. With Tk 8.5, the first line was hidden.
Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscates) Connection:close header.
Issue #1813: Fix codec lookup under Turkish locales.
Issue #12591: Improve support of "universal newlines" in the subprocess module: the piped streams can now be properly read from or written to.
Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without a read1() method), and add an undocumented *write_through* parameter to mandate unbuffered writes.
Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows.
Issue #10883: Fix socket leaks in urllib.request when using FTP.
Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2 directory, so that "import DLFCN" and other similar imports work on
Linux 3.0.
Issue #7484: smtplib no longer puts around addresses in VRFY and EXPN commands; they aren't required and in fact postfix doesn't support that form. Close the call queue in concurrent.futures.ProcessPoolExecutor when shutdown() is called, without waiting for the garbage collector to kick in.
Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
Issue #4376: ctypes now supports nested structures with an endianness different than that of the parent structure. Patch by Vlad Riscutia.
Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a TextIOWrapper to a huge value, not TypeError.
Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors if the process has only one pipe.
Issue #12451: pydoc: html_getfile() now uses tokenize.open() to support Python modules using a encoding different than UTF-8 (reading the coding cookie of the module).
Issue #12451: pydoc: importfile() now opens the Python module in binary mode,
Issue #12451: runpy: run_path() now opens the Python module in binary mode, instead of text mode using the locale encoding, to support other encodings than UTF-8 (modules using the coding cookie).
Issue #12451: xml.dom.pulldom: parse() now opens files in binary mode instead of the text mode (using the locale encoding) to avoid encoding issues.
Extension Modules
Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper signature. Without this, architectures where sizeof void* != sizeof int are broken. Patch given by Hallvard B Furuseth.

v3.19.0 [Jun 27, 2009]
Ordered Dictionaries.
Format Specifier for Thousands Separator.
Other Language Changes.
New, Improved, and Deprecated Modules.
Major performance enhancements have been added.
IDLE’s format menu now provides an option to strip trailing whitespace from a source file.
Build and C API Changes.

v2.6.6150 [Oct 1, 2008]
The major theme of Python 2.6 is preparing the migration path to Python 3.0, a major redesign of the language. Whenever possible, Python 2.6 incorporates new features and syntax from 3.0 while remaining compatible with existing code by not removing older features or syntax. When it’s not possible to do that, Python 2.6 tries to do what it can, adding compatibility functions in a future_builtins module and a -3 switch to warn about usages that will become unsupported in 3.0.
Some significant new packages have been added to the standard library, such as the multiprocessing and json modules, but there aren’t many new features that aren’t related to Python 3.0 in some way.
Python 2.6 also sees a number of improvements and bugfixes throughout the source. A search through the change logs finds there were 259 patches applied and 612 bugs fixed between Python 2.5 and 2.6. Both figures are likely to be underestimates.

Alternative downloads

Python comtypes
Python comtypes
Free
rating

A pure Python COM package based on the ctypes ffi foreign function library.

Python - gevent
Python - gevent
Free
rating

gevent is a coroutine-based Python networking library.

wxPython (unicode) for Python
wxPython for Python
Free
rating

It contains the infamous wxPython demo, other samples, and wxWidgets docs.

Python pycrypto-2.0.1
Python pycrypto-2.0.1
Free
rating

Python is a remarkably powerful dynamic programming language.

Python cgkit-2.0.0alpha8
Python cgkit-2.0.0alpha8
Free
rating

The Python Computer Graphics Kit is a collection of Python modules.