-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
It would be nice to have the option to modify the stem of a file name directly.
Say I have a Path '/tmp/myfile.npy':
file_path = Path('/tmp/myfile.npy')if the file exists, I want to change the file name to '/tmp/myfile-1.npy', in order to avoid overwriting it, I currently need to do the following:
if file_path.exists():
file_path = file_path.parents / (file_path.stem + '-1' + file_path.suffix)It would be much cleaner, if I could instead just do the following:
if file_path.exists():
file_path.stem += '-1'Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Metadata
Metadata
Assignees
Labels
type-featureA feature request or enhancementA feature request or enhancement