wim glenn added the comment: How about if isinstance(seq, collections.Sequence): # do it the usual way .. else: return choice(list(seq)) ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue1551113> _______________________________________