On Sun, Nov 17, 2019, at 16:43, Greg Ewing wrote:
> Probably. I may also have mixed it up with closing(), which
> does something different.

It occurs to me that almost any usage of closing likely has the same problem, 
in that the expression passed to closing may itself throw an exception. It may 
be worth incorporating closing into the mechanism I proposed in another reply 
(i.e. something similar to my deferred_caller, but having its cleanup code call 
.close on the non-context-manager object returned by the given callable)
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/YDQ4GQNZUCGXHZVCRNZULXEVH3NF6OJC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to