Skip to content

Commit 0f5216a

Browse files
kovanclaude
andcommitted
gh-140490: Document versionchanged for PurePath.stem in Python 3.14
Add versionchanged note explaining that the behavior of stem changed in Python 3.14 because a single dot is now considered a valid suffix. Previously 'file.'.stem returned 'file.', now it returns 'file'. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7e2c9bd commit 0f5216a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/library/pathlib.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,12 @@ Pure paths provide the following methods and properties:
486486
>>> PurePosixPath('my/library').stem
487487
'library'
488488

489+
.. versionchanged:: 3.14
490+
491+
A single dot ("``.``") is now considered a valid suffix, which affects
492+
the value of *stem*. In previous versions, ``PurePosixPath('my/file.').stem``
493+
returned ``'file.'``; it now returns ``'file'``.
494+
489495

490496
.. method:: PurePath.as_posix()
491497

0 commit comments

Comments
 (0)