19 Nov
2019
19 Nov
'19
7:31 a.m.
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