I have a problem where I want to keep track over a large number of values. If I never encountered the value, I'll do action A, otherwise - action B. Naturally, I considered using dictionary to keep track of the values, since the lookup is fast, ~O(1).
However, dictionary is a key-value system, while all I want to take advantage of, is the key. I can assign a bogus value
"myvalue": None
but I can't help but wonder if there's a more elegant way to go about it.
Thoughts? Ideas? Thanks!