My question is quite simple.
When I run
someSet = {1,2,3,4}
someSet.discard([5])
It gives the error:
Traceback (most recent call last):
File "File.py", line 2, in <module>
someSet.discard([5])
TypeError: unhashable type: 'list'
Just like list, sets are also unhashable and can't be stored in a set. So, I expect the following code to generate an error:
someSet = {1,2,3,4}
someSet.discard({5})
But to my surprise, it did not generate any error. Why is it so? Does this mean that I am getting an error for list as there something other than it being unhashable which gives rise to the error? If yes, then what is that thing?