#python #programming #datastructure #language
-
An object is
hashable
when it has the methods__eq__
and__hash__
implemented. -
Types defined by user are
hashable
if they attribute never change during it existence/life. -
Strings
,Bytes
andNumbers
are all hashable. -
Containers, like Python Tuples, are
hashable
if theyimutable
and its objects arehashable
as well.
References
Ramalho, 2022, 83-96