Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lib/pathlib/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ def with_suffix(self, suffix):
else:
return self.with_name(stem + suffix)

def without_suffix(self):
"""Return a new path without the file suffix. Readable alternative
for providing empty string to with_suffix.
"""
return self.with_suffix('')

@property
def parts(self):
"""An object providing sequence-like access to the
Expand Down
Loading