mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
4e02c503e7
commit
f1044293fa
5 changed files with 28 additions and 16 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue