[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: Just posted it. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread STINNER Victor
STINNER Victor added the comment: Where should I leave comments on the PEP? Do you plan to post it on python-dev soon? -- ___ Python tracker ___

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread STINNER Victor
STINNER Victor added the comment: > https://github.com/python/peps/pull/1332 Thank you. And good luck for handling incoming discussions on the PEP ;-) -- ___ Python tracker

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: https://github.com/python/peps/pull/1332 -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread Walter Dörwald
Walter Dörwald added the comment: IMHO the names don't fit Pythons current naming scheme, so what about naming them "lchop" and "rchop"? -- nosy: +doerwalter ___ Python tracker

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-20 Thread STINNER Victor
STINNER Victor added the comment: The PEP is a good start. Can you try to convert it to a PR on https://github.com/python/peps/ ? It seems like the next available PEP number is 616. I would prefer to leave comments on a PR. -- ___ Python tracker

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney
Change by Dennis Sweeney : Added file: https://bugs.python.org/file48989/pep-.rst ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney
Change by Dennis Sweeney : Removed file: https://bugs.python.org/file48983/pep-.rst ___ Python tracker ___ ___ Python-bugs-list mailing

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: Here is a draft PEP -- I believe it needs a Core Developer sponsor now? -- Added file: https://bugs.python.org/file48983/pep-.rst ___ Python tracker

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-18 Thread Guido van Rossum
Guido van Rossum added the comment: Sounds good. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: If no one has started, I can draft such a PEP. -- ___ Python tracker ___ ___ Python-bugs-list

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-16 Thread STINNER Victor
STINNER Victor added the comment: The proposed change will affect many builtin types: bytes, bytearray, str, but also other types like collections.UserString. Would it make sense to summarize what has been said in the python-ideas thread into a PEP? It may good to specify things like:

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-15 Thread Guido van Rossum
Guido van Rossum added the comment: I stopped following the discussion at some point, but I think this is worth adding it -- I have seen this done over and over again, and apparently lots of other people have felt the need too. I think these names are fine, and about the best we can do

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido, do you support this API expansion? -- nosy: +gvanrossum, rhettinger ___ Python tracker ___

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-12 Thread Dennis Sweeney
Dennis Sweeney added the comment: Yes: >>> x = "A"*10**6 >>> x.cutprefix("B") is x True >>> x.cutprefix("") is x True >>> y = b"A"*10**6 >>> y.cutprefix(b"B") is y True >>> y.cutprefix(b"") is y True >>> z = bytearray(b"A")*10**6 >>>

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: To be clear, are you only making a copy of the unchanged object if it is a mutable bytearray, not str or bytes? -- nosy: +steven.daprano ___ Python tracker

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Dennis Sweeney
Change by Dennis Sweeney : -- keywords: +patch pull_requests: +18292 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18939 ___ Python tracker ___

[issue39939] Add str methods to remove prefixes or suffixes

2020-03-11 Thread Dennis Sweeney
New submission from Dennis Sweeney : Following discussion here ( https://mail.python.org/archives/list/python-id...@python.org/thread/RJARZSUKCXRJIP42Z2YBBAEN5XA7KEC3/ ), there is a proposal to add new methods str.cutprefix and str.cutsuffix to alleviate the common misuse of str.lstrip and