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

2009-05-19 Thread Duncan Booth
Ben Finney ben+pyt...@benfinney.id.au wrote: MRAB goo...@mrabarnett.plus.com writes: Gunter Henriksen wrote: 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

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

2009-05-19 Thread Ben Finney
Gunter Henriksen gunterhenrik...@gmail.com writes: 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

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

2009-05-19 Thread MRAB
Duncan Booth wrote: Ben Finney ben+pyt...@benfinney.id.au wrote: MRAB goo...@mrabarnett.plus.com writes: Gunter Henriksen wrote: 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

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

2009-05-19 Thread Gunter Henriksen
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. In this case, though, we're

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

2009-05-18 Thread Gunter Henriksen
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. --

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

2009-05-18 Thread MRAB
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.

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

2009-05-18 Thread Ben Finney
MRAB goo...@mrabarnett.plus.com writes: Gunter Henriksen wrote: 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

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

2009-05-16 Thread Ben Finney
Howdy all, I'm slowly developing PEP 3143 and, in parallel, its reference implementation, the ‘python-daemon’ library URL:http://pypi.python.org/pypi/python-daemon/. Feedback continues to be welcome from people wanting to make a program become a daemon; please try it out and critique the

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

2009-05-16 Thread Carl Banks
On May 16, 5:50 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Ideas? How should this be addressed both Pythonically and respecting the intent of PEP 3143? There's already precedent for what to do in the Python library. Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2

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

2009-05-16 Thread Ben Finney
Carl Banks pavlovevide...@gmail.com writes: There's already precedent for what to do in the Python library. Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type help, copyright, credits or license for more information. f = open('somefile') f.close() f.close()

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

2009-05-16 Thread Carl Banks
On May 16, 8:20 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Carl Banks pavlovevide...@gmail.com writes: There's already precedent for what to do in the Python library. Python 2.5.2 (r252:60911, Jan  4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type help, copyright, credits or license for

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

2009-05-16 Thread Ben Finney
Carl Banks pavlovevide...@gmail.com writes: I don't think this is anything more than a trivial consideration, Okay, thank you. Anyone else? -- \ “All television is educational television. The question is: | `\ what is it teaching?” —Nicholas Johnson |