def describe_attributes(obj: Any, attrs: list[str], func: Callable = lambda x: x) -> str:
    """
    Helper for __repr__ functions to list attributes with truthy values only
    (or values that return a truthy value by func)
    """

    pairs = []

    for attr in attrs:
        value = getattr(obj, attr, None)
        if func(value):
            pairs.append(f"{attr}={value}")

    return ", ".join(pairs)

    Helper for __repr__ functions to list attributes with truthy values only
    (or values that return a truthy value by func)
    
libqtile/utils.py