Unyeilding a permutation generator
Jorgen Grahn
grahn+nntp at snipabacken.se
Mon Nov 3 16:09:58 EST 2008
On Sun, 2 Nov 2008 14:09:01 -0800 (PST), Aaron Brady <castironpi at gmail.com> wrote:
> On Nov 2, 3:34 pm, silly... at yahoo.com wrote:
...
>> for x in all_permx("ABCD"):
>> print x
...
> I think multi-threading is the "truest" to the original. You might
> develop a framework to set events when particular generators are to
> take a turn, place their "yields", per se, in a particular place, set
> the return event, etc., and reuse it. Of course, starting threads in
> VBS might be another matter.
Why multi-threading? I see no concurrency in the original algorithm.
There is, in my mind, nothing concurrent about 'yield'.
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!
More information about the Python-list
mailing list