def is_binary_str(var):
    """
    Check whether var is of type BinaryStr.

    :param var: The variable to check.
    :return: ``True`` if var is a :any:`BinaryStr`.
    """
    return isinstance(var, bytes) or isinstance(var, bytearray) or isinstance(
        var, memoryview)
