def relpathto(self, dest):
origin = self.abspath()<EOL>dest = self.__class__(dest).abspath()<EOL>orig_list = origin.normcase().splitall()<EOL>dest_list = dest.splitall()<EOL>if orig_list[<NUM_LIT:0>] != os.path.normcase(dest_list[<NUM_LIT:0>]):<EOL><INDENT>return dest<EOL><DEDENT>i = <NUM_LIT:0><EOL>for start_seg, dest_seg in zip(orig_list, dest_list):<EOL><INDENT>if start_seg != os.path.normcase(dest_seg):<EOL><INDENT>break<EOL><DEDENT>i += <NUM_LIT:1><EOL><DEDENT>segments = [os.pardir] * (len(orig_list) - i)<EOL>segments += dest_list[i:]<EOL>if len(segments) == <NUM_LIT:0>:<EOL><INDENT>relpath = os.curdir<EOL><DEDENT>else:<EOL><INDENT>relpath = os.path.join(*segments)<EOL><DEDENT>return self.__class__(relpath)<EOL>
Return a relative path from self to dest.

        If there is no relative path from self to dest, for example if
        they reside on different drives in Windows, then this returns
        dest.abspath().