title: Set operations in python
body: <p>I am looking for a single set operation to accomplish both the cases below. Is there a way to do this python?</p>
  
  <p>Case 1:<br>
  <code>a = set([1,2])</code> and <code>b = set([1,2,3])</code><br>
  I want a result <code>[1,2]</code>, which is a straightforward intersection. Now <code>set(a)</code> could be empty and performing intersection on empty set with any other set would lead to empty set.</p>
  
  <p>Case 2:<br>
  <code>a = set([])</code> and <code>b = set([1,2,3]) =&gt; set([1,2,3])</code> i.e. set b</p>
  
  <p>How can I achieve case 1 and case 2 with one set operation.</p>