title: join with a separator added at the end when not empty
body: <p>I need to append all elements in <code>list_</code> to a <code>string</code>; at the end I need to add a suffix. A dot '.' has to separate all elements:</p>
  
  <pre><code>list_ = args[f(n) : f(n+1)]
  if list_:
    string += '.' + '.'.join(list_) + '.' + suffix # works except when list_ is empty
  else:
    string += '.' + suffix
  # list_ isn't used after this
  </code></pre>
  
  <p>Can I rewrite it in a simpler way in one line? If <code>join</code> added a separator after each element, it would just this:</p>
  
  <pre><code>string += '.' + '.'.join(args[f(n) : f(n+1)]) + '.' + suffix
  </code></pre>
  
  <p>Edit</p>
  
  <p>I just learned that:</p>
  
  <p>Slices are copies even if they are never assigned to: <a href="https://stackoverflow.com/questions/5722006/does-python-do-slice-by-reference-on-strings">Does Python do slice-by-reference on strings?</a> </p>
  
  <p>But islice may be even worse since it iterates through the start of the list: <a href="https://stackoverflow.com/questions/2738096/itertools-islice-compared-to-list-slice">itertools.islice compared to list slice</a></p>
  
  <p>Some alternatives are discussed here: <a href="https://stackoverflow.com/questions/2328171/avoiding-unnecessary-slice-copying-in-python">Avoiding unnecessary slice copying in Python</a></p>