New submission from John Belmonte <j...@neggie.net>:

Please add aclosing() to contextlib, the async equivalent of closing().

It's needed to ensure deterministic call of aclose() on the resource object at 
block exit.

It's been available in the async_generator module for some time.  However that 
module is intended to provide async generators to Python 3.5, so it's odd for 
apps using modern Python versions to depend on it only for aclosing().

https://github.com/python-trio/async_generator/blob/22eddc191c2ae3fc152ca13cf2d6fa55ac3f1568/async_generator/_util.py#L6

----------
components: Library (Lib)
messages: 365885
nosy: John Belmonte, njs
priority: normal
severity: normal
status: open
title: contextlib.aclosing()
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40213>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to