Message387427
This seems like a very specific use case. Too specific IMO for a method on all string objects for anyone using Python anywhere in the world. Why not just write a function like this?
def my_join(strings, sep=", ", last_sep=", and "):
strings = list(strings)
return sep.join(strings[:-1]) + last_sep + strings[-1]
>>> my_join(["one", "two", "three"])
'one, two, and three' |
|
Date |
User |
Action |
Args |
2021-02-20 21:37:56 | Dennis Sweeney | set | recipients:
+ Dennis Sweeney, f-brinkmann |
2021-02-20 21:37:56 | Dennis Sweeney | set | messageid: <1613857076.11.0.802472558951.issue43280@roundup.psfhosted.org> |
2021-02-20 21:37:56 | Dennis Sweeney | link | issue43280 messages |
2021-02-20 21:37:56 | Dennis Sweeney | create | |
|