[issue28205] Add optional suffix to str.join

2016-09-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Looking again at the comments for the other respondents, I think this > should just be closed. It doesn't make sense to disturb a long > standing API or the break the join/split symmetry. For what it's worth, in hindsight I agree. I'm a little embarassed

[issue28205] Add optional suffix to str.join

2016-09-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: -> resolved ___ Python tracker ___ ___

[issue28205] Add optional suffix to str.join

2016-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Looking again at the comments for the other respondents, I think this should just be closed. It doesn't make sense to disturb a long standing API or the break the join/split symmetry. -- resolution: -> rejected status: open -> closed

[issue28205] Add optional suffix to str.join

2016-09-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger components: +Documentation priority: normal -> low ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: > There were three of us looking at this at work yesterday, > and none of us thought of that. How about adding an example to the docs and calling it a day. -- ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg277004 ___ Python tracker ___

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: -1 for this API expansion. It would be better to have a separate method than to change the root notion of what join() is all about. -- nosy: +rhettinger ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: > '\n'.join(['first', 'second', 'third']) Hum, the workaround is simple: lines = ['first', 'second', 'third'] lines.append('') assert '\n'.join(lines) == 'first\nsecond\nthird\n' -- nosy: +haypo ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: > lines = ''.join(substring + '\n' for substring in substrings) Huh. There were three of us looking at this at work yesterday, and none of us thought of that. -- ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm -1 also, mostly on the grounds that it's not (IME) a very common need and it does clutter up the API. -- nosy: +barry ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm -1. The str interface is already overburdened. This is very special case and there are several ways to do this (Mark's one is the most obvious to me). -- nosy: +serhiy.storchaka ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Steve Holden
Steve Holden added the comment: If you are going to add such a keyword argument, wouldn't it make sense to maintain compatibility with print, and use end=terminator? -- nosy: +holdenweb ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Mark Dickinson
Mark Dickinson added the comment: > Currently the most obvious way to do this is to use a temporary variable: Or more simply: lines = ''.join(substring + '\n' for substring in substrings) -- nosy: +mark.dickinson ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Steven D'Aprano
New submission from Steven D'Aprano: It is moderately common to want to join a sequence of substrings with a delimiter rather than a separator, e.g. when joining a sequence of lines into a single string, you usually want a trailing newline as well as newlines between the lines. E.g.: