def assert_genexpr(g):
    """
    Raise a `TypeError` if an object is not a generator expression.

    Args:
        g: The object to check.
    """
    if g.__name__ != '<genexpr>':
        raise TypeError(f"'{type(g)}' object is not a generator expression")
