If you want to actually solve this problem without doing the thing in the slideshow or shooting yourself, when you see<p><pre><code>    if(self.predicate_function())
      foo()
    else
      bar()
</code></pre>
and self.predicate_function() is only called once in the program (this is the case several times in the slideshow example), try pulling the if statement into the function (and simplify), making a<p><pre><code>    self.handle_case_something()
</code></pre>
function instead. If the predicate is called more than once, consider subclassing. You&#x27;re already doing OO, may as well do it right.