On Sat, Feb 3, 2018 at 6:43 PM, Terry Reedy wrote:
> On 2/3/2018 5:04 PM, Franklin? Lee wrote:
>>
>> Let s be a str. I propose to allow these existing str methods to take
>> params in new forms.
>
>
> Thanks for the honest title. As you sort of indicate, these can all be done
> with re module. H
On Sun, Feb 04, 2018 at 10:54:53AM +1100, Chris Angelico wrote:
> Picking up this one as an example, but this applies to all of them:
> the transformation you're giving here is dangerously flawed. If there
> are any regex special characters in the strings, this will either bomb
> with an exception
On Sun, Feb 4, 2018 at 10:43 AM, Terry Reedy wrote:
> On 2/3/2018 5:04 PM, Franklin? Lee wrote:
>> s.startswith, s.endswith:
>> Allow argument to be a collection of strings.
>
>
> bool(re.match('|'.join(strings)) does exactly the proposed s.startswith,
> with the advantage that the actual mat
On 2/3/2018 5:04 PM, Franklin? Lee wrote:
Let s be a str. I propose to allow these existing str methods to take
params in new forms.
Thanks for the honest title. As you sort of indicate, these can all be
done with re module. However, you imply loops are needed besides, which
is mostly not t
Let s be a str. I propose to allow these existing str methods to take
params in new forms.
s.replace(old, new):
Allow passing in a collection of olds.
Allow passing in a single argument, a mapping of olds to news.
Allow the olds in the mapping to be tuples of strings.
s.split(sep), s.