bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347)

This commit is contained in:
Irit Katriel 2022-01-03 20:10:07 +00:00 committed by GitHub
parent dd6c35761a
commit 51700bf08b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`.