New submission from Марк Коренберг <socketp...@gmail.com>:
#39939 introduced .removeprefix for several classes. I propose adding kwargs-only parameter `, *, strict: bool = False`. It should raise some exception (I'm unuse what exactly) if the string DOES NOT start from specified prefix. False by default only for compatibility purposes. Personally I think it should be True, but I understand why it's impossible to change API. The same about `removesuffix()`. ---------- components: Interpreter Core, Library (Lib) messages: 396627 nosy: socketpair priority: normal severity: normal status: open title: str.removeprefix(): add strict: bool type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44521> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com