summaryrefslogtreecommitdiffstats
path: root/Doc/library/pathlib.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/pathlib.rst')
-rw-r--r--Doc/library/pathlib.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index 3d28a1b..0929ee2 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -559,7 +559,8 @@ Pure paths provide the following methods and properties:
.. method:: PurePath.with_suffix(suffix)
Return a new path with the :attr:`suffix` changed. If the original path
- doesn't have a suffix, the new *suffix* is appended instead::
+ doesn't have a suffix, the new *suffix* is appended instead. If the
+ *suffix* is an empty string, the original suffix is removed::
>>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')
>>> p.with_suffix('.bz2')
@@ -567,6 +568,9 @@ Pure paths provide the following methods and properties:
>>> p = PureWindowsPath('README')
>>> p.with_suffix('.txt')
PureWindowsPath('README.txt')
+ >>> p = PureWindowsPath('README.txt')
+ >>> p.with_suffix('')
+ PureWindowsPath('README')
.. _concrete-paths: