[issue40148] Add PurePath.with_stem()

2020-12-26 Thread Qi Yao


Qi Yao  added the comment:

In Pathlib, we have functions "with_name()""with_stem()""with_suffix()" to 
modify the file name in the path.

In issue21798:"Allow adding Path or str to Path", it actually also want to 
modify the file name, that is "appand string to file name".

if with_stem() more cumbersome as:
path.with_name(path.stem + '_v2' + path.suffix)

why not have a function with_() more cumbersome as:
path.with_name(path.name + "_name.dat")

--
nosy: +tinyaoqi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40148] Add PurePath.with_stem()

2020-04-19 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40148] Add PurePath.with_stem()

2020-04-19 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 8aea4b3605059e243f1827d9328d6fc8d698c0a7 by Tim Hoffmann in 
branch 'master':
bpo-40148: Add PurePath.with_stem() (GH-19295)
https://github.com/python/cpython/commit/8aea4b3605059e243f1827d9328d6fc8d698c0a7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40148] Add PurePath.with_stem()

2020-04-02 Thread Brett Cannon


Brett Cannon  added the comment:

I personally would rather not add more methods that are doing simple string 
manipulations.

--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40148] Add PurePath.with_stem()

2020-04-01 Thread SilentGhost


Change by SilentGhost :


--
nosy: +pitrou
type:  -> enhancement
versions: +Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40148] Add PurePath.with_stem()

2020-04-01 Thread Tim Hoffmann


Change by Tim Hoffmann :


--
keywords: +patch
pull_requests: +18654
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19295

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40148] Add PurePath.with_stem()

2020-04-01 Thread Tim Hoffmann


New submission from Tim Hoffmann :

Similar to PurePath.with_name() and PurePath.with_suffix() there should be a 
PurePath.with_stem().

A common use case would be appending something before the suffix: 
path.with_stem(path.stem + '_v2')

As of now this must be written more cumbersome as:
path.with_name(path.stem + '_v2' + path.suffix)

--
components: Library (Lib)
messages: 365540
nosy: timhoffm
priority: normal
severity: normal
status: open
title: Add PurePath.with_stem()

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com