code: def getBool(t):
      
      b = c_int()
      if PL_get_long(t, byref(b)):
          return bool(b.value)
      else:
          raise InvalidTypeError("bool")
docs: If t is of type bool, return it, otherwise raise InvalidTypeError.