join with generator expression is what was needed. terrific!
From: Rich Lovely
Sent: Friday, July 17, 2009 4:19 PM
To: Dinesh B Vadhia
Cc: tutor@python.org
Subject: Re: [Tutor] large strings and garbage collection
2009/7/17 Dinesh B Vadhia :
> This was discussed in a previous post bu
2009/7/17 Dinesh B Vadhia :
> This was discussed in a previous post but I didn't see a solution. Say, you
> have
>
> for i in veryLongListOfStringValues:
> s += i
>
> As per previous post
> (http://thread.gmane.org/gmane.comp.python.tutor/54029/focus=54139),
> (quoting verbatim) "... the follo
"Dinesh B Vadhia" wrote
This was discussed in a previous post but I didn't see a solution. Say,
you have
for i in veryLongListOfStringValues:
s += i
In general avoid string addition.
(Although recent versions of Python have optimised it somewhat)
As s gets very large, how do you dea
This was discussed in a previous post but I didn't see a solution. Say, you
have
for i in veryLongListOfStringValues:
s += i
As per previous post
(http://thread.gmane.org/gmane.comp.python.tutor/54029/focus=54139), (quoting
verbatim) "... the following happens inside the python interpret