[Python-checkins] CVS: python/dist/src/Lib string.py,1.46,1.47

Jeff Bauer jbauer at rubic.com
Tue Feb 22 09:05:05 EST 2000


[ discussion of join method ]

Tim Peters wrote:
> Write it this way instead, and it reads beautifully & naturally:
> 
> tab = "\t"; space = " "; nospace = ""
> 
> tab.join(list_of_strings)
> space.join(ditto)
> nospace.join(user_sequence)

Tim, 

Not really relevant to your reply to Greg,
but it might be nice to have 'space' and 'tab'
attributes added to the next release of the
string module.  We already have a 'whitespace'
variable and if ' '.join(ditto) ever catches on,
space.join(ditto) might improve readability.

I'm not so sure about nospace, though.  What's
a notab supposed to be? <wink>

'-'.join("uncharacteristically","sincere","ly","y'rs")

-Jeff




More information about the Python-list mailing list