title: why does pylint complain about Unnecessary "elif" after "return" (no-else-return)?
body: <p>why does pylint complain about this code block?</p>
  <p><code>R1705: Unnecessary &quot;elif&quot; after &quot;return&quot; (no-else-return)</code></p>
  <pre><code>def f(a):
      if a == 1:
          return 1
      elif a == 2:
          return 2
      return 3
  </code></pre>
  <p>To prevent the error, I had to create a temporary variable, which feels less pleasant.</p>
  <pre><code>def f(a):
      if a == 1:
          b = 1
      elif a == 2:
          b = 2
      else:
          b = 3
  
      return b
  </code></pre>
  <p><strong>Solution</strong>:</p>
  <pre><code>def f(a):
      if a == 1:
          return 1
      if a == 2:
          return 2
      return 3
  </code></pre>