Python 3.5 adds async and await
Summary
Python 3.5 introduces native coroutine syntax, type annotations and matrix multiplication as important language and library extensions. Python 3.5 was released in September 2015. PEP 492 defined async and await.
Ideas
- async def explicitly defines native coroutines.
- await visibly marks interruptible asynchronous operations.
- Type annotations support external checking tools without enforcing anything at run time.
- The @ operator describes matrix multiplication.
Insights
- Syntax can unify widespread library patterns.
- Explicit suspension points make concurrent flows easier to understand.
- Optional types improve tooling without forbidding dynamic use.
Facts
- PEP 484 standardised type annotations.
Recommendations
- Propagate cancellation and timeouts through asynchronous call chains.
- Introduce type checking gradually for stable interfaces.
References
Links to the original source and the Web Archive open in a new tab.