вс, 31 мар. 2019 г. в 11:36, Steven D'Aprano <[email protected]>:

> There's a slight problem with that: what happens if more than one suffix
> matches? E.g. given:
>
>     "musical".lcut(('al', 'ical'))
>
> should the suffix "al" be removed, leaving "music"? (First match wins.)
>
> Or should the suffix "ical" be removed, leaving "mus"? (Longest match
> wins.)
>
>
I think you should choose  "First match wins", because in this case you can
make "Longest match wins" as `"musical".lcut(tuple(sorted(('al,
'ical'))))`. But if you choose "Longest match wins" there is no chance to
achieve "First match wins" behaviour.

with kind regards,
-gfg
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to