since tuple is immutable, it's hash value will never change, even though it's items are allowed to change (mutate). so why sets and dictionaries can't use a tuple with mutable objects.
example code: tuple = (1, "mayank", [1, "mayank"]) set = {1, "mayank", tuple} error: TypeError: unhashable type: 'list'
extra explanation: tuple contains the 'id' (reference) of objects which will not change throughout the lifetime of respective objects. so the hash of a tuple containing mutable objects should also not change even though the elements are allowed to change (mutate). why then dictionaries and sets can't contain tuple with mutable elements.