In python, is there a difference between calling clear() and assigning {} to a dictionary? If yes, what is it? Example:
clear()
{}
d = {\"stuff\":\"
d = {} will create a new instance for d but all other references will still point to the old contents. d.clear() will reset the contents, but all references to the same instance will still be correct.
d = {}
d
d.clear()