[Patches] [ python-Patches-731701 ] SpawnedGenerator class for threading module
SourceForge.net
noreply@sourceforge.net
Sun, 01 Jun 2003 14:18:41 -0700
Patches item #731701, was opened at 2003-05-02 19:38
Message generated for change (Comment added) made by bcannon
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=731701&group_id=5470
Category: Modules
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Mathieu Fenniak (laotzu0)
Assigned to: Nobody/Anonymous (nobody)
Summary: SpawnedGenerator class for threading module
Initial Comment:
The attached patch adds a new class, threading.SpawnedGenerator,
written by Garth T Kidd in his weblog. (http://
www.deadlybloodyserious.com/Python/2003/04/22.html) The class
wraps a given generator as a new generator that runs in a seperate
thread by retrieving the generator values and storing them in a Queue
object. It's a very nice high-level threading interface. A basic
functionality test has also been added to test_threading.py.
----------------------------------------------------------------------
>Comment By: Brett Cannon (bcannon)
Date: 2003-06-01 14:18
Message:
Logged In: YES
user_id=357491
Since Mathieu said he would open another patch if he got permission from
Mr. Kidd I am going to close this patch as rejected.
----------------------------------------------------------------------
Comment By: Mathieu Fenniak (laotzu0)
Date: 2003-05-08 20:43
Message:
Logged In: YES
user_id=442694
I neglected to think about the copyright issue. I've
contacted Mr. Kidd and requested permission to distribute
this. I hope to receive a response soon. Sorry for
forgetting such an important thing. (if my head weren't
securely fastened...) If permission is granted, I'll submit
another patch with documentation and the other mentioned
issues dealt with.
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2003-05-08 20:04
Message:
Logged In: YES
user_id=31435
This desperately needs a doc patch too -- it's not at all
obvious what this code does, how to use it, or why
someone would want to.
There's a more serious problem of a different kind: you
didn't write the code, and apparently lifted it off a web
page. There's a clear copyright notice on that page, and no
license in sight there. So, apologies in advance, but unless
you have permission from Mr. Kidd to distribute his work,
we have to delete this patch.
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon)
Date: 2003-05-08 16:56
Message:
Logged In: YES
user_id=357491
First off, I think if this patch belongs anywhere it is in itertools and
definitely not in 'threading'. Raymond?
Second, I don't like overriding __call__ to return the generator. It would be
better to just put the body of __call__ into __iter__; the idiom of making
__iter__ a generator is great by preventing someone from having to specify a
separate 'next' method and by making __iter__ create a *new* iterator with
fresh values without having to do some fancy class stuff.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=731701&group_id=5470