Unicode yet again

> cw = [[u'ex', u'HI', u'bit'], [u'TRAIN']]
> print str(' / '.join(' '.join(str(s) for s in w) for w in cw))
Why don't you simply write:

        print ' / '.join(' '.join(w) for w in cw))

You don't have to convert to plain str's. Unicode strings are
first-class citizens in Python, they work transparently most of the
time.

Try that in the interpreter: it works. Then try it in code, where 'print' is replaced by a call to the AppendText method of a TextCtrl. In that context it raises a TypeError: String or Unicode type required.

(The implication that 'w' here is a string in the interpreter, but not when it's an argument to TextCtrl.AppendText(), is for me part of the puzzle.)

Charles Hartman