Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Doc/library/pathlib.rst
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
  • Loading branch information
domragusa and terryjreedy authored May 15, 2021
commit d9c07c2f0f73dcf5c7dc863f9d4eeaeb3cfe64c4
4 changes: 2 additions & 2 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,8 @@ Pure paths provide the following methods and properties:

If the path doesn't start with *other* and *strict* is ``True``, :exc:`ValueError` is raised. If *strict* is ``False`` and one path is relative and the other is absolute or if they reference different drives :exc:`ValueError` is raised.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the key difference should be spelled out in terms of whether adding .. entries is allowed. How about something like this?

In strict mode (the default), the path must start with *other*. In non-strict 
mode, ``..`` entries may be added to form the relative path. In all other 
cases, such as the paths referencing different drives, :exe:`ValueError` is 
raised.

.. warning::
    Non-strict mode assumes that no symlinks are present in the path; you 
    should call :meth:`~Path.resolve` first to ensure this.


NOTE: This function is part of :class:`PurePath` and works with strings. It does not check or access the underlying file structure.

.. versionadded:: 3.11
The *strict* argument (pre-3.11 behavior is strict).
.. versionadded:: 3.10
The *strict* argument (pre-3.10 behavior is strict).

Expand Down