What are the differences between the purposes of generator functions and asynchronous generator functions
问题 In Python, asynchronous generator functions are coroutines, and generator functions are also coroutines. What are the differences between the purposes of generator functions and asynchronous generator functions? Thanks. 回答1: The purpose of PEP 525 -- Asynchronous Generators is pretty much similar to PEP 255 -- Simple Generators which introduced generators. It is mainly intented to make things easier to implement, only in a different domain (asynchronous one). From PEP 525: Essentially, the