Get function's 'namespace path'
<p>I have some namespaces, one included in the other:</p>

<pre><code>class A:
    class B:
        class C:
            def method(): pass

get_ns_path(A.B.C.method) # &gt;&gt;&gt; 'A.B.C.method'
</code></pre>

<p>Is it possible to implement such <code>get_ns_path(func)</code>  that receives a method/function and returns the 'namespace path' as a string?</p>

<p><code>A.B.C.method.im_class</code> gives <code>C</code>, great, but how to go further up?</p>
