[Python-Dev] Idea - place to put string functions and consts (original) (raw)

Barry A. Warsaw barry@zope.com
Mon, 18 Mar 2002 10:27:54 -0500


"GvR" == Guido van Rossum <guido@python.org> writes:

GvR> I still like

GvR>     ",".join(["spam", "eggs"])

GvR> much better.

Me took, especially when it's spelled

COMMA = ','
...
COMMA.join(['spam', 'eggs'])

I use that a lot. The neat thing is that you don't actually have to do anything to get both. This ought to put the join-as-builtin argument to bed, right? ;)

GvR> But str.letters and so on have my blessing.

Me too! Very elegant approach to reducing the last few "import string" still necessary.

-Barry