python-programming

Python 3.6 unleashed!

Python 3.6 has just been released by the Python Software Foundation. This release brings many new syntax features, including formatted string literals and underscores in numeric variables. Significant improvements in CPython implementation and standard library have also been made.

On December 8, 2016, Python 3.6 was released by the Python Software Foundation. Compared to version 3.5, Python 3.6 brings many new features, additional security measures, and tries to make things more productive and easy for developers. This article presents a short overview of the Python 3.6 features and syntax additions. Let’s take a look:

Python 3.6 Features

The version 3.6 has introduced some important syntax features —

Formatted string literals: These are new kind of string literals, also called f-strings. They are prefixed with ‘f’ and contain certain replacement fields surrounded by {}. The replacement fields are expressions that are evaluated at runtime and formatted using format() protocol.

Underscores in numeric literals: For better readability, Python 3.6 brings the ability to use underscores in numeric literals. Now, single underscores can be used between digits and after any base specified.

Syntax for variable annotations: Here, we’re talking about the standard for type annotations of function parameters. This adds the syntax for annotating different types of variables

Asynchronous generators: Python 3.6 improves the support for native coroutines and sync / await syntax introduced in Python 3.5. Now, one can use await and yield in the same function body.

Asynchronous comprehensions: There’s support for using async for in the list, set, dict comprehensions and generator expressions. Also, await expressions are now supported in all types of comprehensions.

Python 3.6 also adds new library modules, CPython implementation improvements, and many security enhancements.

You can visit Python 3.6 What’s new page to know about all the changes in detail.

Python 3.6 Lifespan

This version will continue receiving bugfixes every 3-6 months for the next 18 months. After Python 3.7 release, a final 3.6 bug fix will be released. After that, 3.6 is expected to get security updates until December 2021.

Peter Kivuti
follow

Peter Kivuti

Lead Concept Developer at KayTouch Solutions
Entrepreneur,blogger + creative artist
Peter Kivuti
follow

Latest posts by Peter Kivuti (see all)