I come to praise .join, not to bury it...
Mike C. Fletcher
mcfletch at home.com
Tue Mar 6 09:46:53 EST 2001
Here's a professional aesthetic's take:
mystring.join( )
This is a perfectly normal and good-looking construct. It seems pythonic
and beautiful, object orientation is part of Python, and this works nicely.
"'".join( )
";".join( )
".".join( )
"!".join( )
",".join( )
All look like executable line noise. That is, the literal string's syntax
makes the use of dotted attributes on such a string look jarring and
off-putting. You almost expect some weird function to jump out of this
syntax. It looks very Ruby/Perl-esque.
Note particularly the amount of space between the " character and the .
character. Typographically, " characters serve to set the enclosing data
off from the outer context, and that's the opposite of what you're trying to
do with dot notation. Dot notation normally looks natural because almost
every character that gets used right before the . comes fairly close to the
. (even characters such as r ). Also note: in the common cases of
single-character joins, there's no significant visual weight difference
between what's inside and outside the quotes). Consider what happens when
you alter the proportions of space and the size of the connector...
"."__join( )
"."-->join( )
"."..join( )
" "__join( )
You should find those slightly easier on the eyes (except possibly the " "
one) because the entire "." entity can be understood as a single graphic
with a connector to "join".
That said, I don't think we'll get this particular wart out of the language,
so we'll have to deal with the flaw in the way artists have through the
ages, enhance it and accent it so people start to think it's a beauty mark.
Mike
More information about the Python-list
mailing list