def _build_precondition_join_fn(cls, fn):
 old_precondition = cls.check_precondition
 def check_precondition():
  (result, message) = fn()
  if (not result):
   return (result, message)
  return old_precondition()
 return staticmethod(check_precondition)

def _build_precondition_join_fn ( cls , fn ) : old_precondition = cls . check_precondition def check_precondition ( ) : ( result , message ) = fn ( ) if ( not result ) : return ( result , message ) return old_precondition ( ) return staticmethod ( check_precondition )
build a check_precondition function that uses both the old precondition check as well as the new function fn cls: class whose check_precondition should be used as a base fn: check_precondition function to check returns a function that can replace a handler check_precondition method .