def isinstance2(obj, t):
    """
  Patched isinstance method to disable bool-is-int inheritance.

  >>> isinstance2( True, bool )
  True
  >>> isinstance2( True, int )
  False

  """
    if isinstance(t, (tuple, list)):
        need_bool = bool in t
        need_int = int in t
    else:
        need_bool = t is bool
        need_int = t is int
    res = isinstance(obj, t)
    if not need_bool and need_int:
        res &= not isinstance(obj, bool)
    return res
