[Python-Dev] other "magic strings" issues

Fred L. Drake, Jr. fdrake at acm.org
Fri Nov 7 16:08:41 EST 2003


Brett C. writes:
 > How about a strtools module?  I was thinking that constants like 
 > ascii_letters could go there along with an implementation of join() that 
 > took arguments in an obvious way (or at least the way everyone seems to 
 > request it).

Not sure I like the increasing array of module name suffixes.  There's
the classic "foolib", then we added "footools" and "fooutils" (think
"mimetools" and "distutils").

Not trying to create an issue here, just generally dismayed.

 > Barry's string replacement function could also go there 
 > (the one using $; wasn't it agreed that interpolation was the wrong term 
 > to use or something?).

We're calling it substitution.  People know what that means, and don't
get it confused with interpolation.

 > This would prevent polluting the str type too much plus remove any 
 > hindrance that there necessarily be a mirror value for Unicode since the 
 > docs can explicitly state it only works for str in those cases.

Or it could just work polymorphically.  ;-)  I don't see any need for
everything to be defined by the classes.  Types.  Oh, whatever those
things are!


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation



More information about the Python-Dev mailing list