mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347) (GH-30369)
(cherry picked from commit 51700bf08b)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
50da397be4
commit
4a792ca95c
1 changed files with 6 additions and 1 deletions
|
|
@ -489,11 +489,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