This question is the python version of: Is there a Collection that works like a Dictionary without the values?
I want a data structure that has a list of english words in it, but not their definitions.
Basically: given a sequence of letters, I want to be able to do constant-time O(1) lookup to determine if that sequence is in the english dictionary.
Would a set()
or frozenset()
be the correct choice?
I know that I could use a dictionary where each key's value is None
, but that seems like a waste of memory space.