]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)
authorsweeneyde <36520290+sweeneyde@users.noreply.github.com>
Wed, 22 Apr 2020 21:05:48 +0000 (17:05 -0400)
committerGitHub <noreply@github.com>
Wed, 22 Apr 2020 21:05:48 +0000 (23:05 +0200)
commita81849b0315277bb3937271174aaaa5059c0b445
tree8184e6ab012aa217b5cc1bb242efc6aed531db7d
parent39652cd8bdf7c82b7c6055089a4ed90ee546a448
bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)

Added str.removeprefix and str.removesuffix methods and corresponding
bytes, bytearray, and collections.UserString methods to remove affixes
from a string if present. See PEP 616 for a full description.
13 files changed:
Doc/library/stdtypes.rst
Doc/whatsnew/3.9.rst
Lib/collections/__init__.py
Lib/test/string_tests.py
Lib/test/test_doctest.py
Misc/ACKS
Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-39939.NwCnAM.rst [new file with mode: 0644]
Objects/bytearrayobject.c
Objects/bytesobject.c
Objects/clinic/bytearrayobject.c.h
Objects/clinic/bytesobject.c.h
Objects/clinic/unicodeobject.c.h
Objects/unicodeobject.c