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: Context manager, atexit processing, and PEP 3143 DaemonContext.close

2009-05-19 Thread MRAB
Duncan Booth wrote: Ben Finney wrote: MRAB 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 wa

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

2009-05-19 Thread Ben Finney
Gunter Henriksen 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 exception. In this c

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

2009-05-19 Thread Duncan Booth
Ben Finney wrote: > MRAB 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

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

2009-05-18 Thread Ben Finney
MRAB 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 to be by raising an

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. Th

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. -- http://mail.python.org/ma

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

2009-05-16 Thread Ben Finney
Carl Banks 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 | _o__)

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

2009-05-16 Thread Carl Banks
On May 16, 8:20 pm, Ben Finney wrote: > Carl Banks 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 = op

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

2009-05-16 Thread Ben Finney
Carl Banks 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, 5:50 pm, Ben Finney 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 Type "help", "copyright",

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 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 specificatio