[Python-Dev] Re: ''.join() again
Barry Warsaw
barry@python.org
21 Apr 2003 14:01:17 -0400
On Mon, 2003-04-21 at 13:44, François Pinard wrote:
> > And I'll do my semi-regular rant that
> > COMMASPACE.join(seq)
> > looks a lot nicer than
> > ', '.join(seq)
> > even to the point of starting to /like/ this idiom. :)
>
> Having to name simple string constants like a single space looks overkill.
> It hardly salvages the original ugliness. Admit it: you're stuck! :-)
Never! And though I don't smoke, some of my fondest childhood memories
are walking around the block with my grandfather while he smoked his
cigars. :)
'Course, you don't /have/ to name your string constants, though I
usually do because it improves readability, and because I invariably
find several uses for the same string constant in a single module.
OTOH, I wouldn't object too strenuously to a join() builtin, but I'd
probably never use it -- I'm sure I'd rarely remember the argument order
and hate having too look it up much more than writing out the current
spelling. Admit it: there is no natural unforgetable order! :)
-Barry