[issue42493] pathlib.Path.__eq__ should test normalized path

2020-11-28 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> rejected type: behavior -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing

[issue42493] pathlib.Path.__eq__ should test normalized path

2020-11-28 Thread Austin Scola
Austin Scola added the comment: Okay, thank you for the explanation Eryk. It makes sense to me now why __eq__ doesn't attempt to compare something other than just the parts of the path. -- stage: -> resolved status: open -> closed ___ Python

[issue42493] pathlib.Path.__eq__ should test normalized path

2020-11-28 Thread Eryk Sun
Eryk Sun 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

[issue42493] pathlib.Path.__eq__ should test normalized path

2020-11-28 Thread Austin Scola
New submission from Austin Scola : I think it would be more useful for the pathlib.Path.__eq__ method to test the normalized path (not sure if normalized is the right terminology here). As a concrete example I think that `PosixPath('/foo')` should equal `PosixPath('/foo/../foo')`. This is