On Mon, Oct 24, 2016 at 05:37:29PM -0700, Chris Barker - NOAA Federal wrote:
> > On Oct 24, 2016, at 3:54 PM, Chris Angelico wrote:
>
> > . But in any case,
> > this is a question you can't even ask until replace() accepts multiple
> > arguments. Hence I'm +1 on the notion of simultaneous replace
> On Oct 24, 2016, at 3:54 PM, Chris Angelico wrote:
> . But in any case,
> this is a question you can't even ask until replace() accepts multiple
> arguments. Hence I'm +1 on the notion of simultaneous replacements
> being supported.
Agreed -- there are a lot of edge cases to work out, and ther
On Tue, Oct 25, 2016 at 9:11 AM, Nathan Schneider wrote:
> What would be the expected behavior of "aabbccdd".replace(('a', 'aa'), ('x',
> 'y'))? It's not obvious to me whether longer replacement strings ('aa') or
> earlier replacement strings ('a') should take priority.
I'm actually not sure, so
On Mon, Oct 24, 2016 at 5:56 PM, Chris Angelico wrote:
> On Tue, Oct 25, 2016 at 4:48 AM, Chris Barker
> wrote:
> > On Mon, Oct 24, 2016 at 8:21 AM, Michel Desmoulin
> > wrote:
> >>
> >> This actually could be implemented directly in str.replace() without
> >> breaking the API by accepting:
> >
On Tue, Oct 25, 2016 at 4:48 AM, Chris Barker wrote:
> On Mon, Oct 24, 2016 at 8:21 AM, Michel Desmoulin
> wrote:
>>
>> This actually could be implemented directly in str.replace() without
>> breaking the API by accepting:
>>
>> "stuff".replace('a', '')
>> "stuff".replace(('a', 'b', 'c'), '')
>>
On Mon, Oct 24, 2016 at 8:21 AM, Michel Desmoulin wrote:
> This actually could be implemented directly in str.replace() without
> breaking the API by accepting:
>
> "stuff".replace('a', '')
> "stuff".replace(('a', 'b', 'c'), '')
> "stuff".replace(('a', 'b', 'c'), ('?', '*', ''))
>
+1 -- I have f
Le 22/10/2016 à 10:34, Simon Mark Holland a écrit :
Having researched this as heavily as I am capable with limited
experience, I would like to suggest a Python 3 equivalent to
string.translate() that doesn't require a table as input. Maybe in the
form of str.stripall() or str.replaceall().
My
On Sat, Oct 22, 2016 at 03:34:23PM +0700, Simon Mark Holland wrote:
> Having researched this as heavily as I am capable with limited experience,
> I would like to suggest a Python 3 equivalent to string.translate() that
> doesn't require a table as input. Maybe in the form of str.stripall() or
> s
On 22.10.2016 10:34, Simon Mark Holland wrote:
> Having researched this as heavily as I am capable with limited experience,
> I would like to suggest a Python 3 equivalent to string.translate() that
> doesn't require a table as input. Maybe in the form of str.stripall() or
> str.replaceall().
>
>
Understood, and I agree, I have seen someone make a similar argument for
using RegEx. Here are my main points...
1) Speed - Built-in's are faster.
2) Standardisation - It is a common task, that has MANY ways of being
completed.
3) Frequent Task - It is to my mind as useful as str.strip() or
str.r
I would use list comprehension even if there were some other way to
translate as it is straight forward.
On 10/22/16, Simon Mark Holland wrote:
> Having researched this as heavily as I am capable with limited experience,
> I would like to suggest a Python 3 equivalent to string.translate() that
>
Having researched this as heavily as I am capable with limited experience,
I would like to suggest a Python 3 equivalent to string.translate() that
doesn't require a table as input. Maybe in the form of str.stripall() or
str.replaceall().
My reasoning is that while it is currently possible to eas
12 matches
Mail list logo