Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-21 Thread Steven D'Aprano
On Wed, 21 Sep 2005 11:37:38 +0100, Tom Anderson wrote: > There's a special hell for people who override builtins. [slaps head] Of course there is, and I will burn in it for ever... -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-21 Thread Tom Anderson
On Wed, 21 Sep 2005, Steven D'Aprano wrote: > On Mon, 19 Sep 2005 19:40:12 -0700, jbperez808 wrote: > >> Having to do an array.array('c',...): >> >> >>> x=array.array('c','ATCTGACGTC') >> >>> x[1:9:2]=array.array('c','') >> >>> x.tostring() >> 'AACAGACATC' >> >> is a bit klunkier than one

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-20 Thread Steven D'Aprano
On Mon, 19 Sep 2005 19:40:12 -0700, jbperez808 wrote: > Having to do an array.array('c',...): > > >>> x=array.array('c','ATCTGACGTC') > >>> x[1:9:2]=array.array('c','') > >>> x.tostring() > 'AACAGACATC' > > is a bit klunkier than one would want, but I guess > the efficient performanc

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread jbperez808
Great suggestion... I was naively trying to turn the string into a list and slice that which I reckon would be significantly slower. -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread jbperez808
Having to do an array.array('c',...): >>> x=array.array('c','ATCTGACGTC') >>> x[1:9:2]=array.array('c','') >>> x.tostring() 'AACAGACATC' is a bit klunkier than one would want, but I guess the efficient performance is the silver lining here. -- http://mail.python.org/mailman/listinfo

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread Terry Reedy
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > rs='AUGCUAGACGUGGAGUAG' > rs[12:15]='GAG' >> Traceback (most recent call last): >> File "", line 1, in ? >> rs[12:15]='GAG' >> TypeError: object doesn't support slice assig