Contribute Media
A thank you to everyone who makes this possible: Read More

Async Context Manager for Python 3.7

Description

Day 3, R1 13:00–13:30

Python 3.7針對asyncio做了不少的改動,也是Python進化為3.7版的重要改動項目。這一次的講題想要帶大家認識在Python 3.7成為內建功能的asynccontextmanager。

在學習程式語言的最初階段,我們常常會使用到with語法,確保開啟的資源在使用完之後有確實被關閉或釋放;這在Python的世界裡,我們稱之為contextmanager。而Python 3.7也針對實作contextmanager的函式庫 -- contextlib,做了一些改動,使其支援「async with」這樣的語法。

本次的演講將藉由探討asynccontextmanager的實作與應用,以及它和一般contextmanager的不同之處,讓聽眾了解Python 3.7對於非同步的重視。

Slides: https://gamekingga.com/pycontw2019.pdf

Speaker: Sammy Wen

Currently working at Sinitic Inc as a Senior Backend Engineer while studying in the University of Waterloo as a ECE graduate student.

Python is awesome. It helps me earn a living.

Details

Improve this page