1

I am struggling to understand why in the python purepath library this holds:

>>> pathlib.PurePath("/root") == pathlib.PurePath("///root")
    True

and this also:

>>> pathlib.PurePath("/root") == pathlib.PurePath("////root")
True

but this does not:

>>> pathlib.PurePath("/root") == pathlib.PurePath("//root")
    False

What is the reasoning behind this and is there any way to change that behavior (which would ignoring multiple consecutive slashes and just replacing it by one slash)?

khelwood
  • 55,782
  • 14
  • 81
  • 108
  • What OS? The docs say it delegate to either PurePosixPath or PureWindowsPath. What is the behavior if specifically using the _other_ implementation? – user2864740 Jul 29 '20 at 22:49
  • 2
    Does this answer your question? [What is path //, how is it different from /](https://stackoverflow.com/questions/16840916/what-is-path-how-is-it-different-from) – that other guy Jul 29 '20 at 22:50
  • I am on linux. @thatotherguy thanks, that almost answers my question - any way to change this behavior? – TuBerlinStudent Jul 30 '20 at 12:48

0 Answers0