title: What does sys.intern() do and when should it be used?
body: <p>I came across <a href="https://stackoverflow.com/questions/327223/">this question</a> about memory management of dictionaries, which mentions the <strong>intern</strong> function. What exactly does it do, and when would it be used?</p>
  <p><strong>To give an example:</strong> if I have a set called <strong>seen</strong>, that contains tuples in the form (string1,string2), which I use to check for duplicates, would storing (intern(string1),intern(string2)) improve performance w.r.t. memory or speed?</p>