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 rhettinger
Recipients
Date 2004-09-23.00:05:01
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=80475

Perhaps I've been using it for too long, but I do not find
the error message to misleading.  Also, I like having this
method as simple and lightweight as possible though it may
be worthwhile to add a line to the docs, "If the sequence is
emtpy, raises a TypeError." 

If someone accepts this request, it should implemented as a
try/except rather than an assertion.  That approach would
also let you catch TypeErrors raised is the argument doesn't
define __len__ and __getitem__, for example: 
random.choice(set('abc'))

History
Date User Action Args
2007-08-23 14:26:24adminlinkissue1033038 messages
2007-08-23 14:26:24admincreate