> But I don’t think “terminate” is the right name. Maybe “cancel”? Or even 
> “shutdown(wait=whatever, cancel=True)?”

"terminate" was definitely not a good name, especially because it doesn't 
actually terminate anything, it just cancels some of the operations. Since it 
also has to cooperate with the shutdown method, executing code after the state 
change but also before the wait, probably the best way to implement it would be 
just to add an additional parameter to shutdown. "cancel" seems perfect, by 
default set to false, to not change the current behavior.

Then maybe it would be a good idea to change the __exit__ method to set cancel 
to true if an exception is being handled, but I'm not sure about that.
_______________________________________________
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/XMDBSSMBXFJG2C3DXTNLTCNBGAUQOO2K/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to