Patch # 1145 by Thomas Lee:

str.join(...) now applies str() to the sequence elements if they're
not strings alraedy, except for bytes, which still raise TypeError
(for the same reasons why ""==b"" raises it).
This commit is contained in:
Guido van Rossum 2007-09-27 18:01:22 +00:00
parent 4e02c503e7
commit f1044293fa
5 changed files with 28 additions and 16 deletions

View file

@ -3238,10 +3238,6 @@ def strops():
except ValueError: pass
else: raise TestFailed("''.split('') doesn't raise ValueError")
try: ''.join([0])
except TypeError: pass
else: raise TestFailed("''.join([0]) doesn't raise TypeError")
try: ''.rindex('5')
except ValueError: pass
else: raise TestFailed("''.rindex('5') doesn't raise ValueError")