Wyrmskull wrote: > Your flowing pythonicity (if len(x):) gave me lots of inspiration. Actually, instead of if len(pairs): ... that should have been just if pairs: ... When I started writing the function I initially wanted to special-case len(pairs) == 1. The len() call is a superfluous leftover. Peter