[Python-ideas] Re: Random item from a dict [was Re: Re: dict_items.__getitem__?]

2021-10-09 Thread Christopher Barker
As was discussed the last time, I don’t know that selecting a random item from a dict has a lot of use cases — I’m pretty sure the only time I’ve needed to do it was for Dave Thomas’s “trigrams” coding kata. Though I’m not sure I’ve used random.choice fir anything mor “real” either. But it is a mo

[Python-ideas] Re: Random item from a dict [was Re: Re: dict_items.__getitem__?]

2021-10-09 Thread David Mertz, Ph.D.
On Sat, Oct 9, 2021, 10:44 PM Steven D'Aprano > Apart from a programming exercise and teaching moment, why would you want > to get a random key and value from a dict? In 25-ish years of using Python, > I think that the number of times I've needed to do that is zero. A random > item from a list, do