Stephen J. Turnbull wrote:
> The only cases I can remember are files named things like
> "thesis.doc.doc" in GUI environments. ;-)

For edge cases like that, something like
`"thesis.doc.doc".removesuffix(".doc").removesuffix(".doc")` should
suffice, no? It may not be the cleanest looking solution, but IMO, it's
better than over-complicating the method for something that would be used
rarely at best.

On Mon, Mar 23, 2020 at 1:34 AM Stephen J. Turnbull <
[email protected]> wrote:

> Paul Moore writes:
>
>  > I've needed to remove one prefix/suffix. I've never needed to remove
>  > more than one.
>
> The only cases I can remember are files named things like
> "thesis.doc.doc" in GUI environments. ;-)
> _______________________________________________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/NT3ORR6E54EW3CKJGXGCN7VJWPAG5PBX/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/3ALBB4MJG3ENCNCZ3VWHYYCOHP75O7WS/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to