nice, removeprefix/suffix is so pythonic. Great addition I've seen handrolled implementations of that go buggy because they happened to work in some cases but broke others.
"There have been repeated issues on Python-Ideas [2] [3], Python-Dev [4] [5] [6] [7], the Bug Tracker, and StackOverflow [8], related to user confusion about the existing str.lstrip and str.rstrip methods. These users are typically expecting the behavior of removeprefix and removesuffix, but they are surprised that the parameter for lstrip is interpreted as a set of characters, not a substring."
No, this is exactly the common coding mistake removeprefix/suffix is here to adress. The strip() family removes all characters in the string you pass, so it removes not just "prefix" but also "efix", "prefixix" and "effxpixpefiii".
meta, but I upvoted this comment because it illustrates the exact reason why these functions were added. It adds to the conversation in an important way. Is that not the reason for upvoting in general?
That's kind of complicated, I think people generally use upvotes both to signal that something is wrong, and to signal that the comment detracts from the debate.
This case is actually an interesting edge case - I think downvoters are of the mindset that the comment might spread disinformation, therefore it's better to hide it. But I actually agree with you here - this is something a lot of people think, it is wrong, and it's better to explicitly have people see the wrong information, and learn why it's wrong. That's why the PEP itself mentions this as a common misunderstanding!