Skip to content

Commit d866f2b

Browse files
committed
pythongh-87691: provide an absolute pathlib example under operator
The behaviour is fully explained a couple paragraphs above, but it may be useful to have a brief example to cover the behaviour.
1 parent edfbf56 commit d866f2b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Doc/library/pathlib.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ The slash operator helps create child paths, similarly to :func:`os.path.join`::
222222
>>> q = PurePath('bin')
223223
>>> '/usr' / q
224224
PurePosixPath('/usr/bin')
225+
>>> p / '/another' / 'absolute' / 'path'
226+
PurePosixPath('/another/absolute/path')
225227

226228
A path object can be used anywhere an object implementing :class:`os.PathLike`
227229
is accepted::

0 commit comments

Comments
 (0)