title: Multi-threading safety for python string operation via '%'
body: <p>I have two threading to invoke below function:</p>
  
  <pre><code>template = 'My name is %s'
  
  def sayhi(name):
      global template
      print template % name
  </code></pre>
  
  <p>thread A will invoke as below:</p>
  
  <pre><code>sayhi('Tom')
  </code></pre>
  
  <p>thread B will invoke as below:</p>
  
  <pre><code>sayhi('Jerry')
  </code></pre>
  
  <p>My question is whether it is safety for global var 'template'.</p>
  
  <p>Very thanks!</p>