title: Predicate function as argument
body: <p>I have a function that will take another function and if the function I pass as an argument is true then it does something and if it is false then it does something else, but how do I specify it so that the function that is passed as an argument is a function that returns a bool?</p>
  
  <pre><code>def a_function(function,value):
      if function(value) == True:
         do this
      else:
         do this
  </code></pre>
  
  <p>but if "function" is not a function that returns a bool then my code doesn't work</p>