Christian Heimes wote:
Laszlo Nagy wrote:
IMHO it is much cleaner to implement this as a decorator. Pro:
transparent passing of positional and keyword arguments, keeps function
documentation.
You are entitled to your opinion but I STRONGLY recommend against your
decorator. You MUST
On Oct 9, 3:45 pm, Christian Heimes li...@cheimes.de wrote:
Laszlo Nagy wrote:
IMHO it is much cleaner to implement this as a decorator. Pro:
transparent passing of positional and keyword arguments, keeps function
documentation.
You are entitled to your opinion but I STRONGLY recommend
I personally find it much cleaner this way. Also, why should any code care
in which thread it is executed? Why should I have to derive a class from
some other only because I want to run one of its functions in a separate
thread?
I think you are right! Especially that you can (and probably
On Oct 8, 5:03 am, Ulrich Eckhardt eckha...@satorlaser.com wrote:
sturlamolden wrote:
On 8 Okt, 09:17, Ulrich Eckhardt eckha...@satorlaser.com wrote:
I'm looking at the 'threading' module and see that other than the
'thread' module it doesn't have a simple function to start a new thread.
Laszlo Nagy wrote:
IMHO it is much cleaner to implement this as a decorator. Pro:
transparent passing of positional and keyword arguments, keeps function
documentation.
You are entitled to your opinion but I STRONGLY recommend against your
decorator. You MUST NOT start threads a a side
Christian Heimes wrote:
Laszlo Nagy wrote:
IMHO it is much cleaner to implement this as a decorator. Pro:
transparent passing of positional and keyword arguments, keeps function
documentation.
You are entitled to your opinion but I STRONGLY recommend against your
decorator. You MUST NOT
Hi!
I'm looking at the 'threading' module and see that other than the 'thread'
module it doesn't have a simple function to start a new thread. Instead,
you first have to instantiate a threading object and then start the new
thread on it:
t = threading.Thread(target=my_function)
t.start()
Ulrich Eckhardt írta:
Hi!
I'm looking at the 'threading' module and see that other than the 'thread'
module it doesn't have a simple function to start a new thread. Instead,
you first have to instantiate a threading object and then start the new
thread on it:
t =
On 8 Okt, 09:17, Ulrich Eckhardt eckha...@satorlaser.com wrote:
I'm looking at the 'threading' module and see that other than the 'thread'
module it doesn't have a simple function to start a new thread. Instead,
you first have to instantiate a threading object and then start the new
thread on
Laszlo Nagy wrote:
But really thread.start_new_thread is better:
import thread.start_new_thread as thr
thr(my_function,arg1,arg2)
Please don't use the thread module directly, especially the
start_new_thread function. It a low level function that bypasses the
threading framework. The is no
sturlamolden wrote:
On 8 Okt, 09:17, Ulrich Eckhardt eckha...@satorlaser.com wrote:
I'm looking at the 'threading' module and see that other than the
'thread' module it doesn't have a simple function to start a new thread.
Instead, you first have to instantiate a threading object and then
Laszlo Nagy wrote:
Ulrich Eckhardt írta:
Hi!
I'm looking at the 'threading' module and see that other than the
'thread' module it doesn't have a simple function to start a new thread.
Instead, you first have to instantiate a threading object and then start
the new thread on it:
t =
On Thursday, 8 October 2009 13:24:14 Christian Heimes wrote:
Laszlo Nagy wrote:
But really thread.start_new_thread is better:
import thread.start_new_thread as thr
thr(my_function,arg1,arg2)
Please don't use the thread module directly, especially the
start_new_thread function. It a
Hendrik van Rooyen wrote:
What does the Threading module buy me, other than a formal OO approach?
* the interpreter won't know about your thread when you bypass the
threading module and use the thread module directly. The thread isn't in
the list of active threads and the interpreter is unable
Ulrich Eckhardt wrote:
No, as this one doesn't give me a handle to the thread. I also find this
barely readable, for sure it doesn't beat the readability of the proposed
function.
Roll your own convenient function, though. :) At work we have this short
function in our tool box:
def
15 matches
Mail list logo