Fundamentals 30 min read

Python 3.6 Release Highlights and New Features

The Python 3.6 release introduces numerous language enhancements such as f‑strings, variable annotations, underscore separators in numeric literals, async generators, and improved dictionary implementation, along with extensive standard‑library updates, security improvements, Windows encoding changes, performance optimizations, and new C‑API features.

Architecture Digest
Architecture Digest
Architecture Digest
Python 3.6 Release Highlights and New Features

This document summarizes the key highlights of the Python 3.6 release, covering new syntax features, library additions, implementation improvements, security enhancements, Windows‑specific changes, performance optimizations, and updates to the C‑API.

New Syntax Features

PEP 498 – formatted string literals (f‑strings).

PEP 515 – underscores in numeric literals.

PEP 526 – variable annotation syntax.

PEP 525 – asynchronous generators.

PEP 530 – asynchronous comprehensions.

PEP 487 – simplified class customization via __init_subclass__.

PEP 520 – preservation of class attribute definition order.

PEP 468 – preservation of **kwargs order.

Example of an f‑string:

>> name = "Fred"
>>> f"He said his name is {name}."
'He said his name is Fred.'

Example of a variable annotation:

primes: List[int] = []
captain: str  # no initial value
class Starship:
    stats: Dict[str, int] = {}

New Standard‑Library Modules

secrets – cryptographically strong pseudo‑random numbers for managing secrets.

CPython Implementation Improvements

Compact dict implementation reduces memory usage by 20‑25% compared with Python 3.5.

Class attribute definition order is now preserved.

Keyword argument order is guaranteed to follow insertion order.

Support for DTrace and SystemTap probing.

New PYTHONMALLOC environment variable for debugging memory allocation.

Standard‑Library Enhancements

asyncio becomes stable with many API improvements and performance gains.

Path‑like object protocol added to many filesystem functions.

datetime gains local‑time disambiguation (PEP 495).

hashlib and ssl now support OpenSSL 1.1.0 and new hash algorithms (BLAKE2, SHA‑3, SHAKE).

Various modules (array, ast, collections, concurrent.futures, contextlib, etc.) receive new features and bug fixes.

Security‑Related Improvements

New secrets module for secure token generation.

os.urandom() on Linux now blocks until the entropy pool is initialized.

hashlib adds support for BLAKE2, SHA‑3, SHAKE, and scrypt.

ssl module defaults improved and new cipher suites added.

Windows‑Specific Changes

PEP 528 and PEP 529 switch file system and console encoding to UTF‑8.

py.exe launcher prefers Python 3 when no version is specified.

python.exe and pythonw.exe become long‑path aware.

Support for ._pth files to enforce isolated mode.

Performance Optimizations

16‑bit opcode format enables opcode‑level optimizations.

Asyncio Future and Task receive optimized C implementations.

Typing module performance improved up to 30×.

Various decoder error handlers speed up dramatically.

Bytes and bytearray formatting, fromhex, replace, and other operations see 2‑5× speed gains.

Glob and pathlib glob operations accelerated by up to 6×.

Build and C‑API Changes

Python now requires C99‑compatible toolchains.

Cross‑compilation for Android supported.

New --enable-optimizations configure flag.

New APIs: Py_FinalizeEx , PyErr_SetImportErrorSubclass , PyErr_ResourceWarning , PyOS_FSPath , etc.

Other Notable Updates

Improved handling of repeated traceback lines.

New keywords: async and await become reserved in Python 3.7.

Deprecations for StopIteration in generators, backslash escapes, and import‑spec handling.

PerformancepythonsecurityLanguage Featuresstandard-libraryPEP
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.