[Zope-Coders] unicode question

Guido van Rossum guido@python.org
Tue, 09 Oct 2001 08:30:50 -0400


> > Ideally it should be 'string', 'sequence', 'mapping' and 'number', but
> > as I just explained in python-dev the 'string' name is already taken. :-(
> 
> Would anything really bad happen if you changed the meaning of that string?
> 
> You could then have:
> 
> string
>  |
>  |------unicode
>  |
>  |------ascii

That's what I was proposing, but the problem is this:

assert string.join('/', ['a', 'b']) == 'a/b'
import string
assert string.join(['a', 'b'], '/') == 'a/b'

IOW, introducing a built-in with the same name as a standard module is
bad enough; making them so similar yet different as the string module
and the string base class would be creating a nightmare.  And before
you propose join() to take its arguments in either order, consider
string.join("abc", " / ").

--Guido van Rossum (home page: http://www.python.org/~guido/)