<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вс, 31 мар. 2019 г. в 11:36, Steven D'Aprano <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There's a slight problem with that: what happens if more than one suffix <br>
matches? E.g. given:<br>
<br>
    "musical".lcut(('al', 'ical'))<br>
<br>
should the suffix "al" be removed, leaving "music"? (First match wins.)<br>
<br>
Or should the suffix "ical" be removed, leaving "mus"? (Longest match <br>
wins.)<br><br></blockquote><div><br></div><div>I think you should choose  "First match wins", because in this case you can make "Longest match wins" as <font face="monospace, monospace">`"musical".lcut(tuple(sorted(('al, 'ical'))))`. But if you </font><font face="arial, helvetica, sans-serif">choose</font><font face="monospace, monospace"> </font>"Longest match wins" there is no chance to achieve "First match wins" behaviour.</div><div><br></div><div>with kind regards,</div><div>-gfg</div></div></div>