> I think there's an n-queens solution by Tim Peters somewhere, written > as an example of Python simple generators (which is mostly 'his' > language feature, IIRC). It is in Lib/test/test_generators.py. It also has other examples of fancy footwork with generators . Anyone interested in the topic should read it. Terry J. Reedy