Message363995
It seems that `.join` methods typically return the type of the separator on which they are called:
>>> bytearray(b" ").join([b"a", b"b"])
bytearray(b'a b')
>>> b" ".join([bytearray(b"a"), bytearray(b"b")])
b'a b'
This is broken in UserString.join:
>>> from collections import UserString as US
>>> x = US(" ").join(["a", "b"])
>>> type(x)
<class 'str'>
Furthermore, this method cannot even accept UserStrings from the iterable:
>>> US(" ").join([US("a"), US("b")])
Traceback (most recent call last):
...
TypeError: sequence item 0: expected str instance, UserString found.
I can submit a PR to fix this. |
|
Date |
User |
Action |
Args |
2020-03-12 06:32:03 | Dennis Sweeney | set | recipients:
+ Dennis Sweeney |
2020-03-12 06:32:03 | Dennis Sweeney | set | messageid: <1583994723.34.0.552353280143.issue39944@roundup.psfhosted.org> |
2020-03-12 06:32:03 | Dennis Sweeney | link | issue39944 messages |
2020-03-12 06:32:03 | Dennis Sweeney | create | |
|