mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
docs: clarify Path.suffix (GH-106650)
This commit is contained in:
parent
8d2f3c36ca
commit
f014f1567c
2 changed files with 6 additions and 4 deletions
|
@ -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']
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue