Hi all, thanks for the input. I've revised the patch to account for empty strings and for filenames that look like directories (i.e. that end in a slash).

I've also begun the copyright assignment process, since adding the unit tests lengthened the patch past the critical line count.

As for the naming of `set-extension`, the best I can think of as an alternative would be `with-extension` as a dual to `sans-extension`, although I think `set` still signals the intent well enough. I'll defer to others here.

Cheers,
Colin

On Fri, 4 Jun 2021, at 06:23, Mattias EngdegÄrd wrote:
4 juni 2021 kl. 15.08 skrev Philipp <p.stephani2@gmail.com>:

> Likewise, change the docstring to clarify that a new string is returned.

Actually we usually don't bother saying that a function creates a new string unless this is guaranteed and somehow important, since we don't encourage string mutation anyway. For example, functions are usually allowed to return an unchanged argument string if that would make sense.

Conversely, only functions that do mutate strings need to mention that fact. By default, a user should be able to assume that no string mutation takes place.

I fully agree with the rest of Philipp's excellent points.