[issue43280] additional argument for str.join()

2021-02-20 Thread Steven D'Aprano
Change by Steven D'Aprano : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python

[issue43280] additional argument for str.join()

2021-02-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looking more closely, I think that the semantics are to concatenate the extra argument to the second-last item: ", ".join(["a", "b", "c"]) # -> "a, b, c" ", ".join(["a", "b", "c"], ", and") # -> "a, b, and, c" which would be the same as:

[issue43280] additional argument for str.join()

2021-02-20 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python 3.9 is in feature freeze, this couldn't be added before 3.10 now. You have: ", ".join(["a", "b", "c"], ", and ") outputing this: "a, b, and, c" So what are the semantics of this additional argument? To insert it before the last item?

[issue43280] additional argument for str.join()

2021-02-20 Thread Dennis Sweeney
Dennis Sweeney added the comment: 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 = lis

[issue43280] additional argument for str.join()

2021-02-20 Thread Fabian Brinkmann
Change by Fabian Brinkmann : -- title: addition argument for str.join() -> additional argument for str.join() ___ Python tracker ___ ___