when copying a dict:
aDict.copy()
if you try to use aDict[:]
TypeError: unhashable type: ‘slice’
- Python definition of Hashable is: An object is hashable if it has a hash value which never changes during its lifetime (it needs a hash() method).
- A list is unhashable because its contents can change over its lifetime.
when copying a list:
aList[:]
aList.copy()