Rhodri James wrote:
> On Mon, 07 Dec 2009 18:21:23 -0000, Terry Reedy <tjre...@udel.edu> wrote:
> 
>> r0g wrote:
>>
>>> The trick to threads is to create a subclass of threading.Thread, define
>>> the 'run' function and call the 'start()' method. I find threading quite
>>> generally useful so I created this simple generic function for running
>>> things in threads...
>>
>> Great idea. Thanks for posting this.
>>
>>> def run_in_thread( func, func_args=[], callback=None,
>>> callback_args=[] ):
> 
> I'm might wary of having mutable defaults for parameters.  They make for
> the most annoying errors.  Even though they're actually safe here, I'd
> still write:
> 
> def run_in_thread(func, func_args=(), callback=None, callback_args=()):
> 
> out of sheer paranoia.
> 
>



Excellent point, thanks :)

I'm starting to suspect this is the highest quality group in all of usenet!


Roger.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to