[Python-ideas] Make threading.Event support test-and-set

2016-11-26 Thread Celelibi
Hello, I have a case of multithreaded program where under some condition, I would want to test the flag of the Event object and clear it atomically. This would allow me to know which thread has actually cleared the flag and thus should perform some more work before setting it again. The isSet

Re: [Python-ideas] Decorator to avoid a mistake

2016-11-26 Thread François Leblanc
Le 26 nov. 2016 3:23 PM, "Nick Coghlan" a écrit : > > On 26 November 2016 at 22:24, France3 wrote: > > replace base object by default, and when all is checked for end user > > don't use the flag... > > > > Does it is possible? What do you think about? >

Re: [Python-ideas] Decorator to avoid a mistake

2016-11-26 Thread Nick Coghlan
On 26 November 2016 at 22:24, France3 wrote: > replace base object by default, and when all is checked for end user > don't use the flag... > > Does it is possible? What do you think about? There's no need to do this in a base class, since it can be done via external

Re: [Python-ideas] Decorator to avoid a mistake

2016-11-26 Thread Stephen J. Turnbull
Steven D'Aprano writes: > Sometimes I think Python-as-a-teaching-language and Python-as-a- > production-language are strongly opposed. I haven't found that to be the case. Linters are quite effective, as long as you discipline the students to use them. I don't think this check is in the

Re: [Python-ideas] Decorator to avoid a mistake

2016-11-26 Thread Nick Coghlan
On 26 November 2016 at 21:15, Paul Moore wrote: > On 26 November 2016 at 07:16, Nick Coghlan wrote: >> On 26 November 2016 at 13:26, Guido van Rossum wrote: >>> I think one reason why such proposals are unwelcome to experienced users

Re: [Python-ideas] Decorator to avoid a mistake

2016-11-26 Thread Paul Moore
On 26 November 2016 at 07:16, Nick Coghlan wrote: > On 26 November 2016 at 13:26, Guido van Rossum wrote: >> I think one reason why such proposals are unwelcome to experienced users may >> be that when done right this is totally legitimate, and the