"Lasse Vågsæther Karlsen" <lassevk at gmail.com> wrote: > Ok, that one looks more sleak than what I came up with. For the most efficient and elegant solution, check out Raymond Hettinger's reply to: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/141934 George