Basic Python Query

Johannes Bauer dfnsonfsduifb at gmx.de
Thu Aug 22 04:49:59 EDT 2013


On 22.08.2013 00:50, Fábio Santos wrote:

>>> That said, there is never a need for deriving
>>> from the Thread class, you can also use it to run a function without
>>> that. That way is IMHO clearer because the threading.Thread instance is
>>> not the thread, just like a File instance is not a file. Both just
>>> represent handles for manipulating the actual thing.
>>
>> Huh? That I find most curious.
>>
>> I *always* derive from threading.Thread and really like the way that
>> thread setup works (instanciate Thread handle, call start). Very
>> intuitive, never had the problems with clarity that you mentioned. Could
>> you elaborate on your suggestion? I don't seem to quite get it I'm afraid.
>>
> I cannot tell whether you are trolling or are just new to this,

Neither!

> but you
> don't always have to use threads.

Obviously, I meant "I always derive from threading.Thread when I need to
work with a thread". Thought this was blatantly obvious.

That said, I think I also grossly misunderstood Ulrichs posting. He was
talking about there no need deriving from threading.Thread when you
don't need threads.

What I understood was that, in order to use Threads, you could also just
pass a closure to some static function of threading in order to fire up
a thread. That may or may not be true. However, I find deriving from
Thread, instanciating an object and firing up the thread by using
".start()" much more intuitive.

Hope that clears it all up.

Best regards,
Johannes

-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
 - Karl Kaos über Rüdiger Thomas in dsa <hidbv3$om2$1 at speranza.aioe.org>



More information about the Python-list mailing list