title: Nested if's - what's more Pythonic?
body: <p>Both functions do the same thing. </p>
  
  <pre><code>def function1(self):
      a = self.get_a()
      b = self.get_b()
      c = self.get_c()
      r = None
  
      if a:
          r = a
          if b:
              r = b
              if c:
                  r = c
              else:
                  print("c not set.")
          else:
              print("b not set.")
      else:
          print("a not set.")
  
      return r
  
  
  
  def function2(self):
      a = self.get_a()
      b = self.get_b()
      c = self.get_c()
      r = None
  
      if not a:
          print("a not set.")
          return r
  
      r = a
      if not b:
          print("b not set.")
          return r
  
      r = b
      if not c:
          print("c not set.")
  
      r = c
      return r
  </code></pre>
  
  <p>function1() creates very long lines the more if's are nested which conflicts with PEP8's line-length limit of 78. </p>
  
  <p>function2() might be harder to read/understand and has more return statements. Line length is no problem here.</p>
  
  <p>Which one is more pythonic?</p>