
July 10, 2020
1:52 a.m.
On Fri, Jul 10, 2020 at 3:41 PM Inada Naoki <songofacandy@gmail.com> wrote:
On Fri, Jul 10, 2020 at 1:53 PM Chris Angelico <rosuav@gmail.com> wrote:
And immediately above that part, I said that I had made use of this, and had used it in Python by listifying the dict first. Okay, so I didn't actually dig up the code where I'd done this, but that's a use case. I have *actually done this*. In both languages.
Do you pick random item repeatedly from same dictionary? If so, you can create a list once in Python.
I would pick repeatedly from the same dictionary but it might be mutated in between. So the list would have to be reconstructed fresh every time. ChrisA