'return python path relative to the containing module.'

def getmodpath(self, stopatmodule=True, includemodule=False):

    chain = self.listchain()
    chain.reverse()
    parts = []
    for node in chain:
        if isinstance(node, Instance):
            continue
        name = node.name
        if isinstance(node, Module):
            assert name.endswith('.py')
            name = name[:(-3)]
            if stopatmodule:
                if includemodule:
                    parts.append(name)
                break
        parts.append(name)
    parts.reverse()
    s = '.'.join(parts)
    return s.replace('.[', '[')
