I do not think that's possible:
>>> dir(A.B.C)
['__doc__', '__module__', 'method']
More convincingly, there is no reason why you A.B.Cshould know about A.B, because you can do Z.C = A.B.C, and they will be the same object. So what would you return get_ns_path(Z.C.method)?
Robin source
share