title: Is there a performance advantage to using clear method of a dictonary or set?
body: <p>I just discovered that in Python dictionaries and sets both have a <code>clear</code> method. The method literally just removes all the entries from the object.  </p>
  
  <p>Is there a good reason, or even situation, where it makes sense to call <code>foo.clear()</code> rather than <code>foo = {}</code>, or <code>foo = set()</code>? </p>
  
  <p>I can imagine it might work more efficiently for garbage collection, but it seems to violate "<em>There should be one-- and preferably only one --obvious way to do it.</em>"</p>