This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SpawnedGenerator class for threading module
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, laotzu0, tim.peters
Priority: normal Keywords: patch

Created on 2003-05-03 02:38 by laotzu0, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
spawnedGenerator.diff laotzu0, 2003-05-03 02:38 threading.SpawnedGenerator class and test
Messages (5)
msg43595 - (view) Author: Mathieu Fenniak (laotzu0) Date: 2003-05-03 02:38
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.
msg43596 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-05-08 23:56
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.
msg43597 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-05-09 03:04
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.
msg43598 - (view) Author: Mathieu Fenniak (laotzu0) Date: 2003-05-09 03:43
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. 
msg43599 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-01 21:18
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.
History
Date User Action Args
2022-04-10 16:08:33adminsetgithub: 38437
2003-05-03 02:38:03laotzu0create