[Python-3000] Automatically invoking str() in str.join()

Jack Diederich jack at performancedrivers.com
Fri Apr 28 16:52:29 CEST 2006


On Fri, Apr 28, 2006 at 01:02:44AM -0400, Terry Reedy wrote:
> 
> "Brett Cannon" <brett at python.org> wrote in message 
> news:bbaeab100604272041r2062f339je99e7a2b4ee6ca17 at mail.gmail.com...
> > I wouldn't want it added without ditching the other two versions as
> > well.  Personally I would be fine if string.join() stayed and we
> > considered removing str.join() and just made the string module more
> > prominent (after removing all the deprecated stuff).
> -1
> Get rid of the string module instead.  I consider str.join an advance.  Had 
> trouble remembering arg order of string.join, never do with str.join or 
> actual <string>.join.
> 

I use string.ascii_letters and string.printable() occasionally.
Many of those members could be dropped though (atoi, lowercase, etc)

[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import string
>>> set(dir(string)) - set(dir(str))
set(['ascii_lowercase', '_re', 'letters', 'uppercase', 'ascii_letters', 'capwords', 'index_error', 'Template', 'ascii_uppercase', 'octdigits', '_idmapL', '_int', '_float', 'atol_error', '__builtins__', 'splitfields', 'punctuation', '_multimap', 'joinfields', 'printable', '__file__', 'atof_error', 'atoi', 'hexdigits', 'atol', '__name__', 'atof', 'whitespace', 'digits', 'lowercase', '_long', 'atoi_error', 'maketrans', '_TemplateMetaclass', '_idmap'])
>>> 

-Jack


More information about the Python-3000 mailing list