title: Is the += operator thread-safe in Python?
body: <p>I want to create a non-thread-safe chunk of code for experimentation, and those are the functions that 2 threads are going to call.</p>
  
  <pre><code>c = 0
  
  def increment():
    c += 1
  
  def decrement():
    c -= 1
  </code></pre>
  
  <p>Is this code thread safe?</p>
  
  <p>If not, may I understand why it is not thread safe, and what kind of statements usually lead to non-thread-safe operations.</p>
  
  <p>If it is thread-safe, how can I make it explicitly non-thread-safe?</p>