Issue 32875: Add exit() method to event loops (original) (raw)

Issue32875

Created on 2018-02-19 18:43 by porton, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg312360 - (view) Author: Victor Porton (porton) Date: 2018-02-19 18:43
Please add `__exit__()` method to event loops, to use them with `with`.
msg312675 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-02-24 00:12
Enhancements only go in future releases not yet in beta. Do loops already have an __enter__ method, also required for with? What would you have the close method do? Preemptorially cancel all tasks and close the loop? With statement are usually for ensuring deterministic cleanup after the last substatement, such as closing a file. Can you give a short usage example?
msg312677 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2018-02-24 00:27
Maybe already discussed in Issue 24795?
msg312692 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-02-24 02:39
A. Svetlov, closing #24795: "Superseded by `asyncio.run()` function."
msg312917 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-02-26 11:14
Agree
History
Date User Action Args
2022-04-11 14:58:57 admin set github: 77056
2018-02-26 11:14:26 asvetlov set messages: +
2018-02-24 02:39:47 terry.reedy set status: open -> closedresolution: rejectedmessages: + stage: resolved
2018-02-24 00:27:18 martin.panter set superseder: Make event loops with statement context managersmessages: + nosy: + martin.panter
2018-02-24 00:12:55 terry.reedy set nosy: + terry.reedymessages: + versions: + Python 3.8, - Python 3.6
2018-02-19 18:43:31 porton create