[issue1551113] random.choice(setinstance) fails

wim glenn report at bugs.python.org
Wed May 8 04:57:19 CEST 2013


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>
_______________________________________


More information about the Python-bugs-list mailing list