Message352529
> In modern asyncio code the explicit loop arguments are no longer used since the loop can always be obtained with get_running_loop().
Yeah, the trend changed. Around Python 3.4, passing explicitly loop was preferred for best performances.
Since that time, the code to get the current loop has been optimized, and the new trend is to make the loop implicit to make the code more readable.
--
When I wrote the doc, self.loop.stop() was called explicitly:
https://docs.python.org/3.5/library/asyncio-protocol.html#tcp-echo-client-protocol
It seems like the example has been modified to add a new "on_con_lost" Future.
--
Anyway, thanks Hrvoje Nikšić for your contribution ;-) |
|
Date |
User |
Action |
Args |
2019-09-16 08:15:20 | vstinner | set | recipients:
+ vstinner, rhettinger, hniksic, asvetlov, docs@python, yselivanov, miss-islington |
2019-09-16 08:15:20 | vstinner | set | messageid: <1568621720.34.0.940988162953.issue38178@roundup.psfhosted.org> |
2019-09-16 08:15:20 | vstinner | link | issue38178 messages |
2019-09-16 08:15:20 | vstinner | create | |
|