join vs instances

Robin Becker robin at jessikat.fsnet.co.uk
Sun Dec 9 05:57:35 EST 2001


I had expected to be able to use things like UserStrings interchangeably
with ordinary strings, but 

>>> from UserString import UserString
>>> C=['a',UserString('B'),'c']
>>> ''.join(C)
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
TypeError: sequence item 1: expected string, instance found>
>> C=['a','B','c']
>>> ''.join(C)'aBc'
>>> 

what do I need in a class to get an instance to respect the string join?

-- 
Robin Becker



More information about the Python-list mailing list