A very short post on having fun with coroutines to generate all permutations of a given list.
Fun With Python Coroutines: Generating Permutations
Tagged as
A very short post on having fun with coroutines to generate all permutations of a given list.
An exploration of asynchronous IO, event loops, threads, and coroutines through code written for Node.js and Python 3.4.
Approaching combinatorial generation algorithms using coroutines, with examples in Python. Inspired by Knuth's work in his volume 4 of The Art of Computer Programming, as well as his "Deconstructing Coroutines" paper, co-written with Frank Ruskey.