Python just gave me weird advice:
>>> import random
>>> random.sample({1: 2, 3: 4, 5: 6}, 2)
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
random.sample({1: 2, 3: 4, 5: 6}, 2)
File "C:\Users\*****\AppData\Local\Programs\Python\Python310\lib\random.py", line 466, in sample
raise TypeError("Population must be a sequence. For dicts or sets, use sorted(d).")
TypeError: Population must be a sequence. For dicts or sets, use sorted(d).
Note the second part of the last error line. Why should I sort if I'm going to randomize a moment later anyway? Seems like wasting O(n log n) time.