from typing import Iterable


def count_op(it: Iterable, oper, value):
    """Return a count of the number of items in `it` where **oper** **value**
    == True.  This allows user-defined objects to be included and is subtly
    different to ``[...].count(...)`` which uses the __eq__ operator."""
    return [oper(x, value) for x in it].count(True)