RE: The Running Time of += on Char Strings ?

2005-03-28 Thread Delaney, Timothy C (Timothy)
MyHaz wrote: ''.join(['Thank ','you]) ^^ Syntax error ... Probably better as: ' '.join(['Thank', 'you']) ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

The Running Time of += on Char Strings ?

2005-03-24 Thread Edg Bamyasi
This Is A Late Cross Post from comp.lang.python. It seems the mistery is deeper then i expected. What is the running time of conactination on character strings. i.e. joe=123 joe+=9 is it Amortized Constant time? I don't think it would be O((number of chars)^2) but i really

Re: The Running Time of += on Char Strings ?

2005-03-24 Thread Daniel Dittmar
Edg Bamyasi wrote: What is the running time of conactination on character strings. i.e. joe=123 joe+=9 is it Amortized Constant time? I don't think it would be O((number of chars)^2) but i really don't know. Strings are immutable, so joe+=9 is executed as joe =

Re: The Running Time of += on Char Strings ?

2005-03-24 Thread Stefan Behnel
Edg Bamyasi schrieb: What is the running time of conactination on character strings. i.e. .joe=123 .joe+=9 is it Amortized Constant time? I don't think it would be O((number of chars)^2) but i really don't know. First of all, this idiom is generally avoided in loops (where it

Re: The Running Time of += on Char Strings ?

2005-03-24 Thread MyHaz
Thanks Guys It Was Great Help and I have began to mark my code for the ''.join() string conatination optimization. Upon regoogling (when you know the right thing to google it can make a big diffrence, having not know how to google +=, hehe). I found this commentary and set of tests. I find it a