This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients Julian, ezio.melotti, john.feuerstein, mark.dickinson, rhettinger
Date 2011-09-09.12:04:54
SpamBayes Score 1.2769017e-05
Marked as misclassified No
Message-id <1315569895.2.0.389107868506.issue12941@psf.upfronthosting.co.za>
In-reply-to
Content
> is it really worth adding?

Probably not.  For improvements along these lines, I'd rather see random.choice support sets:

>>> random.choice({1, 2})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/7.1/lib/python2.7/random.py", line 274, in choice
    return seq[int(self.random() * len(seq))]  # raises IndexError if seq is empty
TypeError: 'set' object does not support indexing

But that's another (rejected) issue; see issue 7522.
History
Date User Action Args
2011-09-09 12:04:55mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, ezio.melotti, Julian, john.feuerstein
2011-09-09 12:04:55mark.dickinsonsetmessageid: <1315569895.2.0.389107868506.issue12941@psf.upfronthosting.co.za>
2011-09-09 12:04:54mark.dickinsonlinkissue12941 messages
2011-09-09 12:04:54mark.dickinsoncreate