Context manager, atexit processing, and PEP 3143 DaemonContext.close

MRAB google at mrabarnett.plus.com
Mon May 18 13:43:59 EDT 2009


Gunter Henriksen wrote:
>> Anyone else?
> 
> If there is a function which triggers a one-shot switch, I
> like to have a way to find out if it has already been triggered,
> I prefer to have the function tell me if it triggered the switch
> or not, but I would not want that to be by raising an exception.

The 'file' class also has a 'closed' method, so that's a good model to
follow.



More information about the Python-list mailing list