There are several ways to present the output of a program; data can be printed in a human-readable form, or written to a file for future use. This chapter will discuss some of the possibilities. Fa...| Python documentation
Python's f-strings provide a readable way to interpolate and format strings. They're readable, concise, and less prone to error than traditional string interpolation and formatting tools, such as the .format() method and the modulo operator (%). F-strings are also faster than those tools!| realpython.com
This PEP provides the technical specification for the match statement. It replaces PEP 622, which is hereby split in three parts:| Python Enhancement Proposals (PEPs)
Annotations are a Python technology that allows expressing type information and other metadata about Python functions, classes, and modules. But Python’s original semantics for annotations required them to be eagerly evaluated, at the time the annotate...| Python Enhancement Proposals (PEPs)
PEP 3107 introduced syntax for function annotations, but the semantics were deliberately left undefined. PEP 484 introduced a standard meaning to annotations: type hints. PEP 526 defined variable annotations, explicitly tying them with the type hintin...| Python Enhancement Proposals (PEPs)
In this tutorial, you'll learn about duck typing in Python. It's a typing system based on objects' behaviors rather than on inheritance. By taking advantage of duck typing, you can create flexible and decoupled sets of Python classes that you can use together or individually.| realpython.com
Type hints introduced in PEP 484 can be used to specify type metadata for static type checkers and other third party tools. However, PEP 484 only specifies the semantics of nominal subtyping. In this PEP we specify static and runtime semantics of protoc...| Python Enhancement Proposals (PEPs)
Source code: Lib/asyncio/futures.py, Lib/asyncio/base_futures.py Future objects are used to bridge low-level callback-based code with high-level async/await code. Future Functions: Future Object: T...| Python documentation
This PEP introduces a syntax for adding arbitrary metadata annotations to Python functions 1.| Python Enhancement Proposals (PEPs)
Python supports multiple ways to format text strings. These include %-formatting 1, str.format() 2, and string.Template 3. Each of these methods have their advantages, but in addition have disadvantages that make them cumbersome to use in practice. This...| Python Enhancement Proposals (PEPs)
This PEP introduces a simple and intuitive way to annotate methods that return an instance of their class. This behaves the same as the TypeVar-based approach specified in PEP 484 but is more concise and easier to follow.| Python Enhancement Proposals (PEPs)
Source code: Lib/concurrent/futures/thread.py and Lib/concurrent/futures/process.py The concurrent.futures module provides a high-level interface for asynchronously executing callables. The asynchr...| Python documentation
Source code: Lib/typing.py This module provides runtime support for type hints. Consider the function below: The function surface_area_of_cube takes an argument expected to be an instance of float,...| Python documentation
Editor, Pablo Galindo Salgado,. This article explains the new features in Python 3.10, compared to 3.9. Python 3.10 was released on October 4, 2021. For full details, see the changelog. Summary – R...| Python documentation
Editor, Adam Turner,. This article explains the new features in Python 3.12, compared to 3.11. Python 3.12 was released on October 2, 2023. For full details, see the changelog. Summary – Release hi...| Python documentation
Source code: Lib/contextlib.py This module provides utilities for common tasks involving the with statement. For more information see also Context Manager Types and With Statement Context Managers....| Python documentation
This is a proposal for creating a way to assign to variables within an expression using the notation NAME := expr.| Python Enhancement Proposals (PEPs)
Author, Raymond Hettinger,, Contact,,. Contents: Descriptor Guide- Primer- Simple example: A descriptor that returns a constant, Dynamic lookups, Managed attributes, Customiz...| Python documentation
Compound statements contain (groups of) other statements; they affect or control the execution of those other statements in some way. In general, compound statements span multiple lines, although i...| Python documentation
Protocols and structural subtyping¶| mypy.readthedocs.io
PEP 3107 introduced syntax for function annotations, but the semantics were deliberately left undefined. There has now been enough 3rd party usage for static type analysis that the community would benefit from a standard vocabulary and baseline tools w...| Python Enhancement Proposals (PEPs)
Source code: Lib/functools.py The functools module is for higher-order functions: functions that act on or return other functions. In general, any callable object can be treated as a function for t...| Python documentation
This PEP is a tutorial for the pattern matching introduced by PEP 634.| Python Enhancement Proposals (PEPs)
This PEP proposes to introduce a new syntax, /, for specifying positional-only parameters in Python function definitions.| Python Enhancement Proposals (PEPs)
This PEP specifies an improved syntax for specifying type parameters within a generic class, function, or type alias. It also introduces a new statement for declaring type aliases.| Python Enhancement Proposals (PEPs)
A critical but informative look at the new structural pattern matching feature in Python 3.10, with real-world code examples.| benhoyt.com