Q&A
Q&AWhy can a Python list not be an element of a set?
Set members must be hashable, and a mutable list does not have a stable hash.
Read the concise answer
Sets and dictionary keys rely on a stable hash and equality relationship while a value is stored. A list is mutable, so changing it could invalidate the collection’s lookup structure; Python therefore makes lists unhashable. Use a tuple if its members are also hashable and the value should be immutable.