I read that in pathlib
we can create a child path by using /
between two paths, where a comma would also work. However, I can't find out if there is a difference between the two cases. In the following example, the output is the same:
from pathlib import Path
p = Path('/hello', 'world')
s = Path(p, 'how', 'are', 'you')
ns = Path(p / 'how', 'are', 'you')
print(s)
print(ns)
But considering that pathlib
is heavily object-oriented, I guess there might be something different behind the scenes. Is there a difference between using /
in Path in contrast with a comma?