On 19/11/19 4:54 am, Paul Moore wrote:
"should only manage one resource" is not actually correct - the whole *point* of something like nested() would be to manage multiple resources
I think a better way to say it would be that the __enter__ method should be atomic -- it should either acquire all the resources it needs or none of them. Then it's clear that the with statement should call __exit__ if and only if __enter__ does not raise an exception. -- Greg _______________________________________________ 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/6GP32BXDQWOZPFV73WE2CXSO46EC4OX2/ Code of Conduct: http://python.org/psf/codeofconduct/