In Python, how to write a set containing a set?
<p>We know in Python, a set can be defined by writing out all its elements like this:</p>

<pre><code>a_set={1,"xyz"}
</code></pre>

<p>And books of Python all say elements of a set can be any datatype. So we should be able to write out a set containing a set. I tried to write it as:</p>

<pre><code>a_set={1,{"xyz"}}
</code></pre>

<p>But <a href="http://en.wikipedia.org/wiki/IDLE_%28Python%29" rel="nofollow">IDLE</a> reported an error:</p>

<pre><code>Traceback (most recent call last):
  File "&lt;pyshell#58&gt;", line 1, in &lt;module&gt;
    a_set={1,{"xyz"}}
TypeError: unhashable type: 'set'
</code></pre>

<p>I think this may be because Python is trying to understand it as a dictionary. Then, how to write out a set containing a set in Python?</p>
