How to list all the variable of certain type in python?
<p>When I type <code>dir()</code> in python , it can show all the variables visible, such as:</p>

<pre><code>&gt;&gt;&gt; dir()
['ACCT', 'ACEV', 'ALLOW_THREADS', 'ANNOTE_FONT', 'Annotation', 'AnnoteFinder', 'Arrow', 'Artist', 'AutoLocator', 'Axes', 'BS_KM', 'BUFSIZE', 'Button', 'CF_KM']
</code></pre>

<p>Now I want a function that can list all the variables of certain type, for example '<code>str</code>', by :</p>

<pre><code>&gt;&gt;list_all_variable_of_type(str)
</code></pre>

<p>It will return a list of the variable whose type is 'str' .</p>

<p>How to write the <code>'list_all_variable_of_type()</code>' function ?</p>
