Python way to convert argument list to string
<p>I've inherited some Python code that constructs a string from the string arguments passed into <code>__init__</code>:</p>

<pre><code>self.full_tag = prefix + number + point + suffix
</code></pre>

<p>Maybe I'm just over-thinking it but is this the best way to concatenate the arguments? I know it's possible to do something like:</p>

<pre><code>self.full_tag = "".join([prefix, number, point, suffix])
</code></pre>

<p>Or just using string format function:</p>

<pre><code>self.full_tag = '{}{}{}{}'.format(prefix, number, point, suffix)
</code></pre>

<p>What is the Python way of doing this?</p>

<p>The documentation recommends <code>join</code> for better performance over <code>+</code>:</p>

<blockquote>
  <p><a href="https://docs.python.org/2/library/stdtypes.html#index-22" rel="nofollow">6. ... For performance sensitive code, it is preferable to use the str.join() method which assures consistent linear concatenation performance across versions and implementations.</a></p>
</blockquote>

<p>If performance is not too important, it's more of a matter of taste.</p>

<p>Personally, I find <code>"".join</code> cleaner and more readable than all of those braces in the <code>format</code> version.</p>

python python-2.7