title: When to set related objects with clear=True in Django?
body: <p>The other day I came across the following snippet in the code base I'm working with:</p>
  <pre><code>instance.teachers.clear()
  instance.teachers.add(*teachers)
  </code></pre>
  <p>I was wondering how it was different from simply calling <code>instance.teachers.set(teachers)</code>.</p>
  <p>I <a href="https://docs.djangoproject.com/en/3.0/ref/models/relations/#django.db.models.fields.related.RelatedManager.set" rel="nofollow noreferrer">looked <code>.set()</code> up in the documentation</a> which says:</p>
  <blockquote>
  <p>This method accepts a <code>clear</code> argument to control how to perform the
  operation. If <code>False</code> (the default), the elements missing from the new
  set are removed using <code>remove()</code> and only the new ones are added. If
  <code>clear=True</code>, the <code>clear()</code> method is called instead and the whole set
  is added at once.</p>
  </blockquote>
  <p>Honestly it's still not clear to me what the difference effectively is. I also checked the <a href="https://github.com/django/django/blob/0b655a4bf81f640d3e664f398e635943d4fb7812/django/db/models/fields/related_descriptors.py#L988" rel="nofollow noreferrer">implementation of <code>.set()</code></a> and co and what I found that calling <code>clear()</code>, for instance, will dispatch certain signals. Unless I need this, is there any other point in using it?</p>