Eryk Sun <eryk...@gmail.com> added the comment:
The __eq__ method would have to do a full resolve(), which is expensive and may fail. One can't simply resolve "/foo/symlink/.." as "/foo", where "symlink" is a filesystem symlink. The target has to be resolved before ".." is evaluated, and the link may be invalid or inaccessible. This isn't relevant in Windows because it normalizes ".." components in an opened path with string-based processing before passing the path to the kernel. But, for consistency, one would have to resolve symlinks before comparing paths in Windows as well. I think if you need this in-depth comparison, it's better to call resolve() manually when paths aren't superficially equal. ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42493> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com