If a dictionary contains mutable objects or objects of custom classes (say a queryset, or a even a DateTime), then will calling clear() on the dictionary delet
clear()
It is the same as calling del d['foo'] - it just deletes the entries, but it does not affect the keys or values themselves.
del d['foo']
Of course, they may then become garbage collectible if there are no other references to them.