I was using Pathlib on Python3.x and I found a piece of code that got me curious.
from pathlib import Path
BASE = Path('/mydir').resolve(strict=True).parent.parent
print( BASE / 'Sub-dir')
And that works perfectly, printing out:
/mydir/Sub-dir
I got curious to understand how that works, if someone could help me out. Regards