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. Or do you pick random item from various dictionaries? If so, you application must create many dictionaries, not only picking random item. Unless randam picking part is the bottleneck, micro optimization for this part is not important. That's why the higher level use case is needed to design useful benchmark. Regards, -- Inada Naoki <songofacandy@gmail.com>