]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
docs: clarify Path.suffix (GH-106650)
authorNed Batchelder <ned@nedbatchelder.com>
Thu, 13 Jul 2023 19:24:54 +0000 (12:24 -0700)
committerGitHub <noreply@github.com>
Thu, 13 Jul 2023 19:24:54 +0000 (20:24 +0100)
Doc/library/pathlib.rst
Doc/library/zipfile.rst

index 338575404ff0ad5fa415235daf790c7a5a4e51df..af81df217eea92322ae7e74453a8cdb724854c71 100644 (file)
@@ -432,7 +432,7 @@ Pure paths provide the following methods and properties:
 
 .. attribute:: PurePath.suffix
 
-   The file extension of the final component, if any::
+   The last dot-separated portion of the final component, if any::
 
       >>> PurePosixPath('my/library/setup.py').suffix
       '.py'
@@ -441,10 +441,11 @@ Pure paths provide the following methods and properties:
       >>> PurePosixPath('my/library').suffix
       ''
 
+   This is commonly called the file extension.
 
 .. attribute:: PurePath.suffixes
 
-   A list of the path's file extensions::
+   A list of the path's suffixes, often called file extensions::
 
       >>> PurePosixPath('my/library.tar.gar').suffixes
       ['.tar', '.gar']
index 45f3d340bd82d33b633cd189081fc0dc8af436b4..bd951e4872f1132e6973b351ea5475d2c409430e 100644 (file)
@@ -577,7 +577,8 @@ Path objects are traversable using the ``/`` operator or ``joinpath``.
 
 .. data:: Path.suffix
 
-   The file extension of the final component.
+   The last dot-separated portion of the final component, if any.
+   This is commonly called the file extension.
 
    .. versionadded:: 3.11
       Added :data:`Path.suffix` property.
@@ -591,7 +592,7 @@ Path objects are traversable using the ``/`` operator or ``joinpath``.
 
 .. data:: Path.suffixes
 
-   A list of the path’s file extensions.
+   A list of the path’s suffixes, commonly called file extensions.
 
    .. versionadded:: 3.11
       Added :data:`Path.suffixes` property.