On 4/27/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Phillip J. Eby wrote:
>
> > And thanks to the time machine, str.join('', seq) does this already:
> >
> > Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
> > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >  >>> str.join('',['a','b','c'])
> > 'abc'
> >
> > Who needs a new builtin?  :)
>
> >>> str.join(sep, seq)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: descriptor 'join' requires a 'str' object but received a 'unicode'

I was going to point out this problem too, but of course in Python
3000, str and unicode will be the same thing.  I guess you could run
into the problem if you tried to use a "sep" that was some
user-defined string-like object, but I'm not sure how likely that
would be.

STeVe
--
Grammar am for people who can't think for myself.
        --- Bucky Katt, Get Fuzzy
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to