mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347)
This commit is contained in:
parent
dd6c35761a
commit
51700bf08b
1 changed files with 6 additions and 1 deletions
|
@ -501,11 +501,16 @@ the :mod:`glob` module.)
|
|||
|
||||
>>> splitext('foo.bar.exe')
|
||||
('foo.bar', '.exe')
|
||||
>>> splitext('/foo/bar.exe')
|
||||
('/foo/bar', '.exe')
|
||||
|
||||
Leading periods on the basename are ignored::
|
||||
Leading periods of the last component of the path are considered to
|
||||
be part of the root::
|
||||
|
||||
>>> splitext('.cshrc')
|
||||
('.cshrc', '')
|
||||
>>> splitext('/foo/....jpg')
|
||||
('/foo/....jpg', '')
|
||||
|
||||
.. versionchanged:: 3.6
|
||||
Accepts a :term:`path-like object`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue