[New-bugs-announce] [issue7522] random.choice should accept a set as input
report at bugs.python.org
Wed Dec 16 08:52:42 CET 2009
New submission from Leo <dontsendleospam at gmail.com>:
The following code should just work:
instead the output is TypeError:
TypeError: 'set' object does not support indexing
The algorithm in random.choice requires a sequence, but the semantics of
choice do not, and should not, require a sequence.
The code should be changed to convert the input to a sequence instead.
components: Library (Lib)
title: random.choice should accept a set as input
versions: Python 2.6
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce