On Wed, Mar 25, 2020 at 5:42 PM Dennis Sweeney <sweeney.dennis650@gmail.com> wrote:
I'm removing the tuple feature from this PEP. So now, if I understand correctly, I don't think there's disagreement about behavior, just about how that behavior should be summarized in Python code. [...] return (the original object unchanged, or a copy of the object, depending on implementation details, but always make a copy when working with subclasses)
is well-summarized by
return self[:]
especially if followed by the text
Note that ``self[:]`` might not actually make a copy -- if the affix is empty or not found, and if ``type(self) is str``, then these methods
may, but are not required to, make the optimization of returning
``self``. However, when called on instances of subclasses of ``str``, these methods should return base ``str`` objects, not ``self``.
Perhaps:
Note that ``self[:]`` might not actually make a copy of ``self``. If the affix is empty or not found, and if ``type(self)`` is immutable, then these methods may, but are not required to, make the optimization of returning ``self``. ... [...]