13 Oct
2021
13 Oct
'21
6:47 p.m.
On Wed, 13 Oct 2021 at 19:02, <2QdxY4RzWzUUiLuE@potatochowder.com> wrote:
So aside from filename extensions, what are the real use cases for suffix removal? Plurals? No, too locale-dependent and too many exceptions. Whitespace left over from external data? No, there's already other functions for that (and regexen and actual parsers if they're not good enough). Directory traversal? No, that's what path instances and the os module are for.
I think this is a good point. Is removesuffix really useful enough to warrant having an operator *as well as* a string method? It was only added in 3.9, so we've been managing without it at all for years, after all... Paul