Hi,
Quite often in the last years, I’ve seen situations in which we would need !a!b!c! as output from a list L = ['a', 'b', 'c'], here with separator='!', but it could be with any separator.
I’ve seen people using:
separator + separator.join(L) + separator
separator.join([""] + L + [""])
Proposal: what do you think about
separator.join(L) give a!b!c as usual
separator.join(L, prefix=True) give !a!b!c
separator.join(L, suffix=True) give a!b!c!
separator.join(L, prefix=True, suffix=True) give !a!b!c!
or something similar (with another names) to have cleaner code and avoid the repetition of separator?
I have seen the examples above and also created my own workaround.
If there is a consensus on the topic, that the existing functionality is sufficient, then that is perfectly fine with me. I just thought that this could be an improvement and would make the world easier for customers. And because this old thread existed, I thought that I am not the only one who would use profit from the suggested change.