Random from Dictionary

Emile van Sebille emile at fenx.com
Thu Oct 18 14:14:16 EDT 2001


Which I did, only I tested with numeric keys which doesn't give this error.
Once I put alphas in there, I also see the error, so all around better off
selecting from the keys.

--

Emile van Sebille
emile at fenx.com

---------
"Martin von Loewis" <loewis at informatik.hu-berlin.de> wrote in message
news:mailman.1003425918.15090.python-list at python.org...
> > Perhaps I'm coming in on this thread a bit late (don't remember seeing
it
> > and can't find it at Google Groups, however, so maybe it just hasn't
fully
> > propagated around), but I see nothing in the doc string for
random.choice
> > that suggests it should work with a dictionary.  Where's the bug?
>
> There is no bug; it's just that Emile van Sebille was claiming that
> you could use random.choice on a dictionary.
>
> Regards,
> Martin
>




More information about the Python-list mailing list