Steven D'Aprano <[email protected]> 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:
", ".join(["a", "b, and", "c"])
# -> "a, b, and, c"
I'm not sure how this is useful. In English, there should never be a comma
after the "and", and there possibly shouldn't be a comma after the "b" either,
depending on context.
# Should be: "a, b and c" or "a, b, and c"
See the Oxford or serial comma:
https://thegrammargirls.wordpress.com/tag/oxford-comma/
I'm going to close this feature request. It's too specific and the semantics
don't seem to be very useful. But if you would still like to propose this, or a
similar change, please discuss it first either on the Python-Ideas mailing list:
https://mail.python.org/archives/list/[email protected]/
or at the Ideas topic on
https://discuss.python.org
so that we can determine the required semantics and get a sense for how useful
it would be in general.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43280>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com