python3.x - python yield from 问题
伊谢尔伦
伊谢尔伦 2017-04-17 15:50:33
0
1
422
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
巴扎黑

The statements after yield from will be executed immediately.

This asynchronous means: when coroutine A performs a blocking operation, it temporarily switches to the execution of other coroutines. When the blocking operation of coroutine A is completed, execution will continue from where coroutine A last paused.

According to the meaning in the picture, sleep is considered a blocking operation, so it will be switched to other coroutines for execution. After 1s, the event loop gets the message that the blocking operation of sleep has been completed, so it continues to execute the operations after sleep in hello().

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template