You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.9 has two new methods on str, removeprefix and removesuffix, that collapse these into a single line. They are safer as we usually hardcode the value of len(prefix) and linters will not catch a discrepancy.
The text was updated successfully, but these errors were encountered:
A recurring pattern:
Python 3.9 has two new methods on
str
,removeprefix
andremovesuffix
, that collapse these into a single line. They are safer as we usually hardcode the value oflen(prefix)
and linters will not catch a discrepancy.The text was updated successfully, but these errors were encountered: