<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr"><br></div><div dir="ltr"><br>On 1 Apr 2019, at 02:23, David Mertz <<a href="mailto:mertz@gnosis.cx">mertz@gnosis.cx</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 31, 2019, 8:11 PM Steven D'Aprano <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Regarding later proposals to add support for multiple affixes, to <br>
recursively delete the affix repeatedly, and to take an additional <br>
argument to limit how many affixes will be removed: YAGNI.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">That's simply not true, and I think it's clearly illustrated by the example I gave a few times. Not just conceivably, but FREQUENTLY I write code to accomplish the effect of the suggested:</div><div dir="auto"><br></div><div dir="auto">  basename = fname.rstrip(('.jpg', '.gif', '.png'))</div><div dir="auto"><br></div><div dir="auto">I probably do this MORE OFTEN than removing a single suffix.</div></div></div></blockquote><br><div>Doing this with a for loop and without_suffix is fine though. Without without_suffix it's suddenly error prone. With a without_suffix that takes a typle it's unclear what happens without reading the code. </div><div><br></div><div>I think a single string argument is a great sweet spot: avoid the most error prone part and keep the loop in user code.</div><div><br></div><div>/ Anders </div></body></html>