<p>How do I get a function's name as a string?</p>
<pre><code>def foo():
    pass

&gt;&gt;&gt; name_of(foo)
&quot;foo&quot;
</code></pre>

```
```
my_function.func_name
```
```
There are also other fun properties of functions. Type
```
dir(func_name)
```
to list them.
```
func_name.func_code.co_code
```
is the compiled function, stored as a string.
```
```
import dis
dis.dis(my_function)
```
```
will display the code in
almost
human readable format. :)